freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] Modifying/Enhancing the Truetype Interpreter


From: Moony
Subject: Re: [ft] Modifying/Enhancing the Truetype Interpreter
Date: Mon, 15 Mar 2010 22:09:17 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3

Some issues I'm running into:

Right bearing-
Some letters, for instance Arial normal "v" or "X", or bold "s" appear to have TT instructions that move the right bearing toward the left, a pixel or so (figured this out with FontForge debug). This results in "s" or "v" being smashed up against the following letter at certain point sizes. (see screenshots). Which part of the ttinterp.c code would control this moving of the right bearing, in order that we can disable that part? (It appears that the MS engine got around this problem by keeping instructions on the glyph in the x-direction, to fit into this smaller space, but IMO, it looks bad.)


Gamma / LCD filtering-
It looks as if the MS TT engine does a major gamma "correction" after running its LCD filter. I've gotten results that look very similar by creating a custom FIR filter { 40, 75, 86, 75, 40 } and then gamma-correcting in ftdiff to between 1.5 and 2.2. (See screenshots). I am unable to create a FIR filter that does this all in one step however. I'm guessing that this is because the FIR filter splits intensity across pixels, but gamma applies to the whole pixel? Are there any gamma correction patches out there that can be applied to ftlcdfil.c to render in such a way, like it does with gamma-correction in ftdiff? (I know gamma correction is expensive, and ideally shouldn't be done at the freetype level, but it would still be nice to have the option, IMO.)


FDEFs-
I'm not sure how to approach searching the FDEFs for certain opcode patterns, in order to disable them. Suggestions?


Vertical stem snapping-
This is a weird one. The MS engine is clearly doing snapping of vertical stems to fit symmetrically across pixels at certain ppems (13 - 15?), but other times not (17 - 20?). Yet, the glyphs don't seem as constrained in the x-direction as they do with the TT-instructed b/w rasterizer. I guess I'm interested in getting a good balance between not deforming glpyhs too much (such as in the case of s, v, or w), yet doing vertical stem alignment under certain circumstances, such as n, m, h, or u.... and also leaving enough room for certain glyphs, like v, w, X, etc. Any thoughts on this?


I like the idea about adding PGM output... seems relatively easy to implement.

-Moony


Freetype-rendered, using default LCD filter:
http://www.infinality.net/files/arial-default-lcd.png

Freetype-rendered, using custom FIR filter { 40, 75, 86, 75, 40 } and then gamma-correcting to 1.7:
http://www.infinality.net/files/arial-darkened-gamma-corrected.png

Rendered with WinXP:
http://www.infinality.net/files/arial-cleartype.png







reply via email to

[Prev in Thread] Current Thread [Next in Thread]