freetype
[Top][All Lists]
Advanced

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

Re: example ligature code.


From: Werner LEMBERG
Subject: Re: example ligature code.
Date: Fri, 21 Jul 2000 19:16:16 +0200 (CEST)

> > Does anyone have any example code demonstrating how to use the
> > GSUB extensions to handle ligatures?  I am rendering some arabic
> > using the arial font.  The text looks like it should have a
> > ligature substitution; but none is happening even though I am
> > using the "liga" feature.
> > 
> > I know I am doing something wrong, but I would grateful for any
> > assistance.
> > 
> I believe that you need to use other features like "fina", etc. for
> arabic.  Werner and Antoine would probably be able to answer more
> precisely on this.

As David wrote, please check ftstrtto.  To make ligatures work in
Arabic it is necessary to activate all tables like this (assuming that
arab.utf8 contains a small Arabic string in UTF-8 encoding):

  ftstrtto -s arab -f init -f medi -f fina -f liga \
           -x -u 20 arial.ttf - < arab.utf8

Reason: `liga' is the last OpenType feature applied (the first is
`init', then `medi' and `fina') and works only after the three other
tables have adjusted the glyph indices since ligatures depend on the
position within the Arabic word (e.g. whether it is final or initial).

ftstrtto uses the file arabic.c which assigns Arabic script properties
to the input characters, according to the algorithm given in the
Unicode book.

Attached is a sample input file and an image showing the result using
arial.ttf (version 2.76).


    Werner

Attachment: arab.utf8
Description: Text document

Attachment: arab.png
Description: PNG image


reply via email to

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