Re: [ft] Font rasterization

2010-05-13 Thread Werner LEMBERG

 Is hinting the default for FreeType?

Basically yes, but the default font flags is something to be selected
by the application.

 Does it need rewriting to use design metrics?

I think so.  At least for TrueType, you have to make a distinction
between rendering for screens and rendering on paper.  TrueType has
been designed so that up to a certain size and low DPI values, you
should use integer coordinates and hinted glyphs (which should be
optimized for a given ppem value), together with B/W rendering and
size-specific metrics which can differ enormously from the design
metrics.  Remember that the whole hinting issue has been invented
exactly for that.  It was revolutionary 20 years ago; today it's
rather a burden.

On the other hand, it is fully sufficient if you use integer
coordinates without hinting to get excellent results in case the DPI
value is sufficiently large.

Thus the Qt guy is right: For the UI, the `traditional' way is the
right one.

 From what I understand, the functionality's already in place, and
 it's just that Qt's not making use of it.  Could some of the
 developers of FreeType comment on the issue?

Microsoft's introduction of ClearType (which essentially provides
sub-pixel positioning for low DPI values) is a paradigm change, and it
took some years to make MS applications support that.  I don't know
whether Qt on Windows already uses ClearType features.  And yes, the
functionality is there, at least with the autohinter (and soon with
the TrueType engine too).


Werner

___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Font rasterization

2010-05-11 Thread Werner LEMBERG

 I have recently come across a great article about font rendering,
 http://www.antigrain.com/research/font_rasterization/

Thanks for the pointer, I haven't known this article.

 It basically states (and very convincingly illustrates) that the
 secret to very good font rendering is to use only vertical pixel
 alignment, [...]
 
 So, let me reiterate my main inquiry: is it possible (with freetype)
 to use vertical hinting and pixel alignment only, leaving subpixel
 rendering to take care of the horizontal aspect?

The `light' autohinting mode disables horizontal hinting (and in case
of italic fonts).

For native TrueType hinting, a volunteer is working on it right now,
implementing better ClearType support.  This will probably part of the
next FreeType version (to appear still in May) as an experimental
feature.

For PS fonts, the situation is unsatisfying currently since there are
some bugs lurking around which noone has time to take care of.  Here,
you can't disable horizontal hinting.  It has been suggested to use
the autohinter for PS hinting also, but again, noone has time to
implement it.


Werner

___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Font rasterization

2010-05-11 Thread Tor Andersson
Victor,

On 5/11/10, Victor loonyphoe...@gmail.com wrote:
 Hello!

 I apologize in advance if this is not the place to ask this question, but
 freetype doesn't seem to have a forum anywhere, so...

 I have recently come across a great article about font rendering,
 http://www.antigrain.com/research/font_rasterization/

 It basically states (and very convincingly illustrates) that the secret to
 very good font rendering is to use only vertical pixel alignment, which I
 take means to apply hinting only vertically. Horizontally, the article
 suggests to use subpixel rendering -- that would mean very good scalability
 and shapes. I have tried many configurations in an attempt to produce the
 same result (
 http://www.antigrain.com/research/font_rasterization/text_ft_antigrain.pngis
 a handcrafted example of what that would achieve), but horizontal
 pixel
 alignment seems to kick in even when disabling hinting completely. This is
 evidenced by characters having the same width with diffrent sizes. For
 example, if you scale the line l, its length
 will increase unevenly: at first it would change very little and then
 suddenly make a great leap. Either that, or that line would seem to have
 unevenly distributed spaces between the characters.

 I'm wondering if I just can't figure out how to configure it all correctly,
 or if the pixel alignment is built in without the ability to turn it off
 somehow. Or if maybe it's the creators of web browsers, office suites or
 desktops environments don't know how to achieve such an effect.

 So, let me reiterate my main inquiry: is it possible (with freetype) to use
 vertical hinting and pixel alignment only, leaving subpixel rendering to
 take care of the horizontal aspect?

With regard to pixel alignment, it is certainly possible to render
glyphs with a fractional offset with Freetype. This is set with
the vector argument to FT_Set_Transform(). Sadly most UI
toolkits and all web browsers that I have seen make the assumption
that all fonts will be hinted horizontally and as such only calculate
the glyph metrics and positioning using integers.

-Tor

___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype