freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] ttfautohint: fun with assembler code


From: Just Fill Bugs
Subject: Re: [ft-devel] ttfautohint: fun with assembler code
Date: Sat, 07 May 2011 10:31:08 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Shredder/3.1.11pre

On 04/30/2011 04:07 AM, Werner LEMBERG wrote:

I've had some hope to show working bytecode stuff at the beginning of
May, but things are a bit more complicated, unfortunately: While the
library has been extended to support generated bytecode already, I
have first to define some auxiliary bytecode functions to support
hinting similar to FreeType's autohinter.
.

Here an example.  The following code is taken from
`af_latin_compute_stem_width', transformed into some pseudo code which
can be easier converted to bytecode:

   Function: compute_stem_width

...

This corresponds to the following (still untested) bytecode:

   // In the comments below, the top of the stack (`s:')
   // is the rightmost element.

   // Function 0: compute_stem_width
   //
   // in: width
   //     is_serif
   //     is_round
   // out: new_width
   // CVT: std_width

   0xB0, // PUSHB_1
   0x00, //   0
....

   0x59, // EIF
   0x2D, // ENDF


It took me three hours to write that small bit of code, but meanwhile
it's getting much faster :-)


Those look really mind boggling.

Maybe you can make use of the xgridfit tool to semi auto-gen
the TT instructions.

1. map the pseudo code to xgridfit xml
2. generate .sfd from the xgridfit with an empty font.
3. ripoff the TT instruction from .sfd
4. edit the TT instruction further to fit ttfautohint.

You can even write a script to automatic the 2, 3 steps.





reply via email to

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