freetype
[Top][All Lists]
Advanced

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

Re: [ft] FT_Load_Glyph() slow?


From: armin
Subject: Re: [ft] FT_Load_Glyph() slow?
Date: Wed, 10 Apr 2019 09:10:18 +0100

Let me provide you with a quick answer until Werner comes back to you with
more details :)

> I'm currently using the following functions to load glyphs:
> FT_Get_Char_Index()
> FT_Load_Glyph()

These are two vastly different functions;  `FT_Get_Char_Index' is basically
a no-operation (just a few pointer dereferences + offset hopping) while
`FT_Load_Glyph' can (depending on the settings) even render your bitmap
(https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#f
t_load_xxx).

> We noticed our rendering was slow, so we instrumented around these two
calls.
> We're running on a 32 bit processor, but was still surprised to find that
> FT_Load_Glyph() was taking 500ns. Is this a known issue? Is there a way to
> speed this up? Maybe use FT_New_Memory_Face()? If so, a pointer to an
example
> would be greatly appreciated.

The runtime of `FT_Load_Glyph' heavily depends on many, many things.  First
and foremost the font format and the glyph itself.  Obviously, glyph size
comes into play as well (depending on the font format and your load flags).
If you have the feeling that things go really wrong, I would kindly ask you
to provide the exact font you're using as well as a minimal working code
sample (one specific glyph in that case, eg) so we can talk about concrete
instances;  otherwise we (spec. Werner) cannot give you concrete answers :)

Best
Armin




reply via email to

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