[Top][All Lists]

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

Re: [ft] are there font types for which FT_LOAD_NO_RECURSE is supposed t

From: Werner LEMBERG
Subject: Re: [ft] are there font types for which FT_LOAD_NO_RECURSE is supposed to fail?
Date: Fri, 21 Sep 2018 12:53:06 +0200 (CEST)

> When loading with DejaVuSans.ttf with FT_LOAD_NO_RECURSE there are
> glyphs that have format as FT_GLYPH_FORMAT_COMPOSITE, but the
> metrics are the same as when loaded without FT_LOAD_NO_RECURSE.  On
> the other hand in that .ttc file loading with FT_LOAD_NO_RECURSE
> makes all the metrics as zero even for glyphs that are NOT
> What I am seeing is that depending on the file (or file type I
> guess) the metrics are or are not zero when loading with

Yes.  The Noto font is a CFF (inspite of having the file name
extension `.ttc'), while DejavuSans is a TTF.  For the former,
FreeType only returns rudimentary metrics information if you are using
FT_LOAD_NO_RECURSE, mainly for debugging purposes.  Actually, CFFs
don't have composite glyphs at all, and the only meaningful metrics
value returned for the FT_LOAD_NO_RECURSE case is the `horiAdvance'
field (if FT_LOAD_VERTICAL_LAYOUT is not set).  Note also that pure
CFFs[*] always have a left bearing value of zero, IIRC.  The
`horiBearingX' values that you get for `normal' calls to
`FT_Load_Glyph' come from the font's `hmtx' table.

Thanks for the report; I've updated the documentation.


[*] A `pure CFF' is a PostScript resource file that doesn't have an
    SFNT wrapper.

reply via email to

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