freetype
[Top][All Lists]
Advanced

[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: Kevin Rogovin
Subject: Re: [ft] are there font types for which FT_LOAD_NO_RECURSE is supposed to fail?
Date: Fri, 14 Sep 2018 18:08:05 +0300

Hi,

 My BIG apologies for getting this wrong. The issue was not that the
outline were not present, but rather when loading the glyphs
non-recursively, the metrics were different. (the reason why I made this
mistake is because I had early out code for when the metrics gave a size of
0x0).

Specifically (as an example, but this file NotoSansCJK-Regular.ttc behaves
this way on nearly all glyphs), loading the glyph #41 with:

FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP |
FT_LOAD_IGNORE_TRANSFORM | FT_LOAD_LINEAR_DESIGN

gives the width and height of face->glyph.metrics as 527x733 but adding the
flag FT_LOAD_NO_RECURSE gives the size as 0x0 (however the bounding box
remains the same).  In addition, when loading with FT_LOAD_NO_RECURSE both
the vertical and horizontal bearings have both coordinates zero (without
the FT_LOAD_NO_RECURSE they are non-zero).  In contrast, loading glyph
#137  from the ever popular DejaVuSans.ttf, with or without the
FT_LOAD_NO_RECURSE flag gives the size as 1204x1915.

Is this expected behavior where .ttc fonts have their bearings and size as
0 when loading without recursion?

Best Regards,
 -Kevin

On Tue, Sep 4, 2018 at 4:44 PM Kevin Rogovin <address@hidden>
wrote:

> Hi,
>
>   A font on my Ubuntu
> distribution: /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc does
> not seem to cooperate loading glyphs without recursion. Specifically, I
> load with the options:
>
>  FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING
>     | FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM
>     | FT_LOAD_LINEAR_DESIGN | FT_LOAD_NO_RECURSE
>
> (I realize that a number of flags imply others, but I like to be
> explicit). For this .ttc font, loading the font this way gives that all
> glyphs have no outline but also no sub-glyphs. Dropping the
> FT_LOAD_NO_RECURSE option, I get outlines (but naturally no sub-glyph
> data). On the other hand, for a number of .ttf fonts I get the sub-glyphs
> just fine with the above flags. For reference, I am running with an
> unmodified freetype-2.9.
>
> Is there something that I am missing in this situation?
>
> Best Regards,
>  -Kevin Rogovin
>


reply via email to

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