[XeTeX] chess fonts with xelatex

Ulrike Fischer news2 at nililand.de
Sun Jan 13 16:06:00 CET 2008


Am Sat, 12 Jan 2008 23:56:20 +0000 schrieb Jonathan Kew:

> On 12 Jan 2008, at 2:58 pm, Ulrike Fischer wrote:
> 
>> I was now wondering if I could add some support for ttf chess fonts
>> installed in the normal (windows) fonts folder. To be able to do it
>> I must somehow reencode the fonts.
>>
>> Unicode can not be used as chess fonts are highly unstandard. Most
>> chars don't have a unicode number. Also the different authors of the
>> fonts did put the chars quite randomly in the character table and
>> also used various glyphs name.
> 
> There are chess pieces encoded at U+2654 onwards, but yes, I expect  
> various chess fonts have additional idiosyncratic glyphs that may not  
> have Unicode values. And old chess fonts probably don't use the  
> Unicode encoding even for the basic symbols.

The chess pieces encoded in Unicode are only the ones of the
"figurine" set, which are used to print the notation of a game. But
chessfss deals also with the chars for boards and the so-called
informator symbols (for comments). 



> 
>> So in the psfonts.map almost every font has its own encoding vector:
>>
>> chess-pirat-lsf ChessFigurinePirat " ChessPiratFigEncoding
>> ReEncodeFont " <chess-pirat-fig.enc <chess-pirat-fig-raw.pfb
>>
>> How could such reencoding be done with XeTeX if the fonts are in the
>> system font folder?
> 
> I suppose it should be possible to use the font-mapping mechanism  
> (like the tex-text mapping that's commonly used with Latin-script  
> fonts). 

I already looked a bit at the font-mapping. As far as I understand
it, I would have to add the mapping command to the .fd-files. Which
means that I would have to define new encodings (like the
eu-Encoding) solely for the use with XeTeX and maintain a lot of
additional .fd-files and additional code to switch between the
encoding. I do find this quite complicated. Also, I don't think that
the fd-files are the right place for informations specific to an
engine (like xetex) or a system (like the decision if a ttf-font or
a pfb-font, a free font or a professional one is used). With
pdflatex/dvips you can add such informations through the
psfonts.map: There you can decide if you want to use the mf-version
of the ec-fonts or the cm-super-fonts, if you want to use the
urw-version of times or a professional one. 

Isn't there anywhere a file similar to the psfonts.map where you can
define "font aliases" but which is specific to XeTeX so that is
don't mess up dvips and pdflatex? Or a command like the pdfmapfile
of pdflatex? 


> You could write mappings for each font to map some standard  
> character encoding (preferably Unicode!) to the font-specific codes  
> needed.

The mappings to a standard encoding (and the standard itself)
already exist: That's the main part of enpassant/chessfss. I only
have to find a way to tell XeLaTex to use them even for fonts which
are not installed in the texmf-tree. And if in some future Unicode
encodes the chars needed I'm quite willing to adapt my standard. 

-- 
Ulrike Fischer 



More information about the XeTeX mailing list