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 15:57:48 +0300

Hi,

 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 FT_GLYPH_FORMAT_COMPOSITE.

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 FT_LOAD_NO_RECURSE. For
example running the simple program I attached earlier:

$ ./glyph_probe /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf 126
# 126: SAME
HP = size = 1782x1549, hBearing = (137, 1520), vBearing = (-855, 249), box
= [137, 1919]x[-29, 1520], nc = 4, np = 29
VP = size = 1782x1549, hBearing = (137, 1520), vBearing = (-855, 249), box
= [137, 1919]x[-29, 1520], nc = 4, np = 29
SubGlyphs:
#123, matrix = {65536, 0, 0, 65536}
#2896, matrix = {65536, 0, 0, 65536}
#2855, matrix = {65536, 0, 0, 65536}
SP = size = 1782x1549, hBearing = (137, 1520), vBearing = (-855, 249)

but with the .ttc file mentioned earlier:

$ ./glyph_probe /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc 30
#  30: SAME
HP = size = 479x307, hBearing = (38, 522), vBearing = (-239, 358), box =
[38, 517]x[215, 522], nc = 2, np = 8
VP = size = 479x307, hBearing = (38, 522), vBearing = (-239, 358), box =
[38, 517]x[215, 522], nc = 2, np = 8
Non-composite: SAME SP = size = 0x0, hBearing = (0, 0), vBearing = (0, 0),
box = [38, 517]x[215, 522]

i.e.  with that .ttc file, loading with FT_LOAD_NO_RECURSE makes the
metrics zero even for non-composite glyphs and for DejaVuSans.ttf loading
with FT_LOAD_NO_RECURSE gives the metrics correctly for both composite and
non-composite glyphs.

On Wed, Sep 19, 2018 at 1:58 PM Alexei Podtelezhnikov <address@hidden>
wrote:

> On Wed, Sep 19, 2018 at 2:37 AM Kevin Rogovin <address@hidden>
> wrote:
> > 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.
>
> No. It depends on the glyph format (FT_GlyphSlot->format)
>
> https://www.freetype.org/freetype2/docs/reference/ft2-basic_types.html#FT_Glyph_Format
> You should not be using metrics from FT_GLYPH_FORMAT_COMPOSITE. For
> other glyph formats this flag does nothing but imposes those other
> flag dependencies.
>


reply via email to

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