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