[Top][All Lists]

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

[ft] FT_GlyphSlot_Oblique doesn't alter metrics whereas FT_GlyphSlot_Emb

From: Omar Cornut
Subject: [ft] FT_GlyphSlot_Oblique doesn't alter metrics whereas FT_GlyphSlot_Embolden does?
Date: Thu, 10 Jan 2019 19:13:08 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0


Apologies if I am misled here, but I'm noting that FT_GlyphSlot_Embolden() alter the slot metrics, e.g. code includes.
    slot->metrics.width        += xstr;
    slot->metrics.height       += ystr;

Whereas FT_GlyphSlot_Oblique() doesn't. It only calls FT_Outline_Transform(). Shouldn't FT_GlyphSlot_Oblique alter metrics to expose the typically altered width?

After I call FT_Render_Glyph() the width found in face->glyph->bitmap->width is typically larger than the metrics width.
Should not this be reflected in metrics ahead of the render?

(My context is the following: I am trying to understand if it is possible to obtain the expected size of a bitmap _before_ rendering it. I need sizes ahead of time to pack rasterized glyphs into an atlas. Rendering the glyphs twice is out of question because this is an expensive enough operation it actually does affect my initialization time meaningfully. Peeking into the slot metrics seems to works well _unless_ I start using  FT_Render_Glyph() in which case there is a mismatch between the size in metrics and the rendered glyph size).

Being new to FreeType it is possible I am misunderstanding something.


reply via email to

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