[Top][All Lists]

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

Re: [ft] Query regarding FreeType

From: Werner LEMBERG
Subject: Re: [ft] Query regarding FreeType
Date: Wed, 05 Apr 2017 14:49:26 +0200 (CEST)

Hello Ammar!

For further communication, please write to the address@hidden'
mailing list and not to me privately.

> Our team in lab is doing some research regarding new font language.
> Our aim is to create a new Font language from the programmable font


> For creating a new Font driver my first test case is to make a
> replica of type1 driver and try to access it with some client
> application (to render some type1 styled text).

The simplest driver is probably `winfnt', which I recommend as a
starting point.  The `type1' driver also needs the `psnames',
`pshinter', and `psaux' modules, optionally using the auto-hinter
module also; this makes the code more complicated to understand in the

> My query is that i am unable to find the place in FreeType which
> actually decides that which driver to call.  I mean when a .ttf file
> is inputted than where FreeType decides that Truetype driver has to
> deal with this for rasterizing.

It's actually very simple.  The main loop for iterating over the font
drivers is in file `src/base/ftobjs.c', function
`ft_open_face_internal' (lines 2250ff in the current version of the
git repository).  It eventually calls

  clazz->init_face  (line 1210)

which points to a module's font initialization routine.  If this
routine succeeds – this is, the module was able to successfully parse
the font header –, this font driver is taken, otherwise the next one
is tried.

The order of font modules is given in file `modules.cfg'; FreeType's
`Makefile' constructs the header file `ftmodule.h' based on this data.

> According to my research there is a tool named Ftrandom in tools
> directory but i am not sure if it is used for this purpose or the
> parse file in each driver main source directory.

The `ftrandom' tool is used to create fuzzy (i.e., buggy or invalid)
input to test whether the library can properly reject it.  It is not
part of the library itself.


reply via email to

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