freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Render a text on Horizontal using a ttf file which contai


From: DanY
Subject: Re: [ft-devel] Render a text on Horizontal using a ttf file which contains also Vertical metrics
Date: Thu, 18 May 2017 12:13:05 +0000 (UTC)

Thank you for your quick response.

I'm using "SharpFont" library from NuGet in this way:
            
            LibFace.LoadGlyph(glypgIndex, LoadFlags.Default | hintingFlag, LoadTarget.Normal); 
            LibFace.Glyph.RenderGlyph(RenderMode.Normal);

            // Get a bitmap that .Net can draw
            var ftbmp = LibFace.Glyph.Bitmap;
            if ((ftbmp.Width != 0) && (ftbmp.Rows != 0))
            {
                // Normal Glyph
                var bmp = ftbmp.ToGdipBitmap(GlyphColor);
            }

I don't use this flag "LoadFlags.VerticalLayout" (0x000010)
"LoadFlags.VerticalLayout" flag from SharpFont is "FT_LOAD_VERTICAL_LAYOUT " from FreeType.

But when the ttf file used by me contains both metrics inside ("hmtx" and "vmtx" tables) somehow the FreeType "prefers" to read data from "vmtx" table in order to create the glyphs.
Or can I set explicitly to use a Horizontal Layout?

Of course I'm aware that the problem can come from my code or from my ttf file used or from SharpFont, but I would ask you if you know a bug in this area (in FreeType)

Please see also my attached picture.

Thank you,



On Thursday, May 18, 2017, 1:08:19 PM GMT+3, Werner LEMBERG <address@hidden> wrote:
> I'm trying to render a Chinese text on Horizontal and I'm using a
> ttf file which contains both metrics inside (Horizontal and
> Vertical).  The glyphs obtained seems to be based on Vertical
> metrics.

I don't understand what you mean.  Can you repeat the issue with one
of the FreeType demo programs?


> Can I force somehow to obtain the glyphs based on Horizontal
> metrics?


Of course.  If you don't use the FT_LOAD_VERTICAL_LAYOUT flag with
FT_Load_Glyph, you are using horizontal metrics.


    Werner

Attachment: glyphs compare.png
Description: PNG image


reply via email to

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