[HarfBuzz] pango and harfbuzz

Behdad Esfahbod behdad at behdad.org
Wed Jun 12 11:00:40 PDT 2013


On 13-06-12 12:19 PM, Felipe Heidrich wrote:
> Thank you Behdad, that is important information to me.
> 
> It seems I will need a mix of pango+harfbuzz.
> pango to itemzime+font-fallback and harfbuzz for shaping (with font features
> support, linear layout).

This should work.


> Do you happen to know what the browsers (firefox, webkit) are doing  ?

They do their own itemization / font-fallback, and use harfbuzz or the system
libraries to do shaping.


> Back to rendering, as far as glyph rasterization goes, is there anything I can
> do with cairo/pangocairo that I can't do directly with freetype ?
> Basically I need  8bpp grayscale and 24bpp LCD masks (which I'll upload to an
> opengl texture).

Not really.  Lots of bookkeeping and caching...


> Ideally I need to produce subpixel text positioned glyphs (at 0, .33, .66).

Then doing it yourself is easiest indeed.

behdad

> Thanks
> Felipe
> 
> 
> 
> On Tue, Jun 11, 2013 at 5:41 PM, Behdad Esfahbod <behdad at behdad.org
> <mailto:behdad at behdad.org>> wrote:
> 
>     On 13-06-10 06:04 PM, Felipe Heidrich wrote:
>     > Hello,
>     >
>     > I'm evaluating pango and harfbuzz to use with javafx and I have a couple
>     > questions:
>     >
>     > 1) Advance typographic features (i.e
>     > http://dev.w3.org/csswg/css-fonts/#font-rend-props)
>     > In pango I was only able to find support for small caps (in PangoVariant)
> 
>     Correct.  Pango doesn't currently have API to enable those.  Though, it's
>     straightforward to add.
> 
> 
>     > In harfbuzz, hb_shape() takes an array of hb_features_t. I suppose any
>     feature
>     > available in the font can be selected using harfbuzz ?
> 
>     Yes.
> 
> 
>     > 2) glyph advances
>     > Is there any difference between glyph advances produced harfbuzz and pango ?
>     > I would like, if possible, to use linear (non-hinted) advances.
> 
>     No.  With HarfBuzz you have more control over things, but if you disable
>     hinting and request a font at a large size you are good to go.
> 
> 
>     > Note that I started with pango since it provides a complete solution
>     including
>     > -itemizer (not mandatory for me)
>     > -shaper
>     > -font fallback (I think)
>     > -glyph metrics (xMax, yMax, xMin, yMin)
>     > -glyph images
>     > -glyph outlines
> 
>     Correct.
> 
> 
>     > Turns out that for most of what I'm doing I also need either cairo or
>     freetype
>     > to work with pango.
>     > I'm not 100% on this one, but using cairo does not provide anything
>     extra (as
>     > it seems cairo uses freetype).
>     > So instead of using pango+cairo or (pango+freetype) I could directly use
>     > freetype (for glyph images/outlines/metrics) and harfbuzz (for shaping
>     complex
>     > text).
> 
>     You can.  But you have to deal with itemizing, bidi, font fallback, etc,
>     yourself.
> 
>     behdad
> 
> 
>     > Please advise.
>     >
>     > Thank you
>     > Felipe
>     >
>     >
>     >
>     > _______________________________________________
>     > HarfBuzz mailing list
>     > HarfBuzz at lists.freedesktop.org <mailto:HarfBuzz at lists.freedesktop.org>
>     > http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>     >
> 
>     --
>     behdad
>     http://behdad.org/
> 
> 

-- 
behdad
http://behdad.org/



More information about the HarfBuzz mailing list