[lltx] luaotfload update

Khaled Hosny khaledhosny at eglug.org
Thu Oct 6 16:28:54 CEST 2011


On Thu, Oct 06, 2011 at 02:40:51PM +0200, Ulrike Fischer wrote:
> Am Thu, 6 Oct 2011 09:11:46 +0200 schrieb Ulrike Fischer:
> 
> >> Otherwise, XeTeX supports these features with its Unicode input
> >> mapping feature -- what are the chances this could be written
> >> with a Lua callback? It's a useful feature in itself, and the big
> >> reason polyglossia is currently XeTeX-only.
> > 
> > You could use a fea-file as a replacement, e.g. to implement  such
> > ligatures.
> 
> This here seems to work. 
> 
> \documentclass{article}
> \begin{filecontents*}{tex-dash.fea}
> languagesystem DFLT dflt ;
> languagesystem latn dflt ;
> feature tdas {
>    sub hyphen hyphen hyphen by emdash;
>    sub hyphen hyphen by endash;
> } tdas ;
> \end{filecontents*}

This looks fine, AFAIC it is essentially how it was implemented (though
ConTeXt is modifying the lua tfm table directly).

> 
> \usepackage{fontspec}
> \setsansfont[FeatureFile=tex-dash.fea, RawFeature=+tdas]{Arial}
> \setmainfont[FeatureFile=tex-dash.fea, RawFeature=+tdas]{Times New
> Roman}
> 
> \begin{document}
>  -- --- \sffamily -- --- 
> \end{document}
> 
> Comments:
> 1. You must delete the temp-arial-tex-dash.lua etc files in the
> luatex-cache after you changed the fea-file or you won't see the
> changes.

I don't need this here, I recall this being fixed for some time now.

> 2. A bit surprisingly the ligatures seem to work with Renderer=Full
> (Some month ago kerning features worked only with Renderer = Basic)

It should work, kerning is a bit tricky because of discretionary nodes
IIRC.

> 3. I'm not quite sure about the "languagesystem" declarations and if
> something is missing in the feature file.  

Here is the tricky part, ConTeXt code have special wild card for script
any language any, but feature files don't have an equivalent for that so
selecting a different script or language will deactivate the ligatures
(I've to check the OTF spec and see if features in DFLT script should be
always be applied or not, if yes may be I can get Hans to implement
that.)

Also this have the same downside as ConTeXt code being dependant on
glyph names being consistent, unlike the XeTeX's mappings which operate
on characters.

Regards,
 Khaled

-- 
 Khaled Hosny
 Egyptian
 Arab


More information about the lualatex-dev mailing list