freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] [Doubt] About reading a font file to check for its driver


From: Parth Wazurkar
Subject: Re: [ft-devel] [Doubt] About reading a font file to check for its driver.
Date: Mon, 07 May 2018 21:11:08 +0000

As the number of drivers is quite small it won't actually speed up FreeType. But having an initial guess for checking drivers can certainly remove some constant time complexity required to check through different drivers..

I doubt if there are any other issues with this approach?

--
Parth

On Tue 8 May, 2018, 2:28 AM Werner LEMBERG, <address@hidden> wrote:

> while going through the code I found out that in file
> `src/base/ftobjs.c` in the function `ft_open_face_internal`, if the
> driver is not specified in the `FT_Open_Args' instance variable then
> it tries to open_face from all the installed available drivers for
> appropriate formats.  Isn't this an extra overhead?  Can't we to
> determine the driver from its filename extension?

No, we can't.  First of all, it sometimes happens that fonts are
incorrectly called `*.ttf', but in reality they are `*.pfb' (I've seen
this in the wild).  Second, some Adobe fonts don't have an extension
at all.

On the other hand, the file extension is a strong indicator which font
driver to use, so maybe the used algorithm can be streamlined by
taking the extension into account to compute a first guess.

I'm not sure whether this really speeds up FreeType...


    Werner

reply via email to

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