[XeTeX] [OT] OpenType Turkish language tag

Will Robertson wspr81 at gmail.com
Sat Jul 8 13:39:18 CEST 2006


On 08/07/2006, at 0:36 , Ralf Stubner wrote:

> Would it be possible in fontspec to support both language tags? Say if
> the user asks for Language=Turkish, 'TRK' is first tested. If that  
> does
> not exist, fontspec could look for 'TUR' emitting an error/warning, if
> that doesn't exist either.

Hmmm, looks like I don't have any fonts that use the correctly  
specified tag. (All my Adobe fonts use 'TUR'.) Could I ask a favour  
from someone to test my code? This snippet in the preamble should be  
all you need:

\makeatletter
\define at key[zf at feat]{Lang}{Turkish}[]{%
   \zf at check@ot at lang{TRK}%
   \if at tempswa
     \c at zf@language\@tempcnta\relax
     \xdef\zf at language@name{Turkish}%
     \xdef\zf at family@long{\zf at family@long+lang=Turkish}%
     \xdef\zf at pre@ff{\zf at pre@ff language=TRK,}%
   \else
     \zf at check@ot at lang{TUR}%
     \if at tempswa
       \c at zf@language\@tempcnta\relax
       \xdef\zf at language@name{Turkish}%
       \xdef\zf at family@long{\zf at family@long+lang=Turkish}%
       \xdef\zf at pre@ff{\zf at pre@ff language=TUR,}%
     \else
       \zf at PackageWarning{Font \fontname\zf at basefont does not contain
                          language 'Turkish' for script  
'\zf at script@name'}%
     \fi
   \fi}


Then
   \fontspec[Language=Turkish]{ <font with 'TUR'> } fi
   \fontspec[Language=Turkish]{ <font with 'TRK'> } fi
should be enough to check everything works.

Sorry for the bother...

Will


More information about the XeTeX mailing list