[HarfBuzz] Default hb_font_t scale

Behdad Esfahbod behdad at behdad.org
Thu Oct 1 22:49:38 PDT 2015


Thanks.  I'm also going to make sub_fonts inherit the scale from their parents.

On 15-10-01 09:54 PM, Konstantin Ritt wrote:
> Here is my +1
> 
> 
> Regards,
> Konstantin
> 
> 2015-09-30 14:29 GMT+04:00 Behdad Esfahbod <behdad at behdad.org
> <mailto:behdad at behdad.org>>:
> 
>     Since there's been no objections, I'll go ahead and make this change.
> 
>     On 15-09-02 09:12 AM, Behdad Esfahbod wrote:
>     > Right now default scale is 0,0 when a new font is created.  Should I change
>     > that to upem,upem?  That sounds like a more useful default.
>     >
>     > Specifically, this pattern is becoming more common:
>     >
>     > parent_font = hb_font_create (face);
>     > hb_ot_font_set_funcs (parent_font);
>     >
>     > font = hb_font_create_sub_font (parent_font);
>     > hb_font_set_funcs(font, custom_funcs...);
>     >
>     > hb_font_set_scale(font, ...);
>     >
>     >
>     > This way custom funcs can provide only a few (say, hinted h_advance)
>     function
>     > and everything else comes from parent_font.  For size-related things (like
>     > glyph_extents()) that do come from parent_font, they are scaled properly to
>     > match the scale of the new font, but that will only work if the scale of
>     > parent_font is NOT zero, otherwise the extents will be converted to a
>     scale of
>     > zero (ie, they all become zero), then go through a division by zero!
>     >
>     > Changing the default scale addresses that, and plus, make "shape at font
>     > units" the default behavior.
>     >
>     > Objections?
>     >
>     > Cheers,
>     >
> 
>     --
>     behdad
>     http://behdad.org/
>     _______________________________________________
>     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/


More information about the HarfBuzz mailing list