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: Wed, 19 Sep 2018 09:37:06 +0300

Hi,

When I looked at the code, I saw that FT_LOAD_NO_RECURSE implies
FT_LOAD_NO_SCALE
and FT_LOAD_IGNORE_TRANSFORM which in turn imply FT_LOAD_NO_HINTING,
FT_LOAD_NO_BITMAP
and kills FT_LOAD_RENDER. This is documented. However, that glyph metrics
are not loaded with  FT_LOAD_NO_RECURSE is buried behind the function
pointer of the font-format driver, driver->clazz->load_glyph. Also, on
DejaVuSans.ttf, loading the glyph with  FT_LOAD_NO_RECURSE gives the same
metrics value as without it. Where as for NotoSansCJK-Regular.ttc the
metrics are all 0 with FT_LOAD_NO_RECURSE. I am thinking that whether or
not glyph metrics are loaded with FT_LOAD_NO_RECURSE is dependent on font
driver, i.e font format.

I've attached a some-what silly scanner whose base flags are
FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP |
FT_LOAD_IGNORE_TRANSFORM | FT_LOAD_LINEAR_DESIGN and I load the glyph with
these flags 3 times: once just with those, then once with those and
FT_LOAD_NO_RECURSE and once with those and FT_LOAD_VERTICAL for the purpose
of comparing the results for glyphs of fonts.

Best Regards,
 -Kevin Rogvin



On Wed, Sep 19, 2018 at 6:14 AM Alexei Podtelezhnikov <address@hidden>
wrote:

> Kevin,
>
> To understand relationships between the flags, please study just a few
> lines of code here:
>
> http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/base/ftobjs.c#n818
>
> FT_LOAD_NO_RECURSE basically cancels everything including metrics
> calculations. It only gives you a list of glyph components for a
> composite glyph if any. It is also the only way to get that
> information. So if you really need both metrics and components, you
> have to load the glyph twice.
>
> Alexei
>

Attachment: glyph_probe.cpp
Description: Text Data


reply via email to

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