[lltx] Reencode chessfonts with luaoftload

Ulrike Fischer news3 at nililand.de
Mon Oct 25 20:08:05 CEST 2010


Am Mon, 25 Oct 2010 13:07:29 +0200 schrieb Khaled Hosny:

>> Before continuing on this way I have some questions:
>> 
>> 1. Is using a .fea-file to reencode a font the right idea?
 
> That is not reencoding per se, just glyph substitution, so it depends on
> what you want to achieve. If you are substituting from "K" glyph that
> does not exist in the font, then the substitution code will be ignored
> (feature files operate on glyphs not code points). If chess symbols are
> supported by Unicode, then one possible solution is to actually reencode
> the fonts while processed by LuaTeX so that using proper Unicode code
> points will always work, but this is not trivial (well, I don't know how
> to do it, actually, but it is doable since Hans is doing a similar trick
> in his virtual Unicode math fonts).

There are some chess symbols in the unicode charts. But only a small
part of the symbols I need. And I doubt that the rest (like "masks
glyphs") will ever find their way into Unicode. Glyph substituation
is quite ok. And as the chess fonts are so individual I will have to
write a fea file for each of the fonts and so can ensure that only
glyph which exits in the fonts are used. 

>> 3. The pirat font (http://www.enpassant.dk/chess/downl/pirat.zip)
>> used above shows already some on the problems of the project: The
>> font seems to have a text font as base. To get slots for the chess
>> symbols it has moved some of the chars backward. Now the king (glyph
>> name c140) is on position 140, the position of å, the å is on
>> position 229 (Å), luaotfload seems to haved realized this, the
>> temp-lua-file of the font contains  c140={ 229, 140 } and my
>> substituation rule gets me an "å" instead of the King I want. How
>> can I correct to rule?
> 
> There is something odd with the fonts, it seems to have the same glyph
> referenced in multiple slots, for example the king is on c162 too, 

It is a different king, it has another bounding box. I can use it
(the type1 variant is doing it) but I would still like to know how I
could access the other one. It works if I change in the
temp-pirat-testsubs.lua in the unicodes table c140={ 229, 140 } to
c140 = {140}. So I think the question is, can I manipulate this
value after the definition of the font?





-- 
Ulrike Fischer 



More information about the lualatex-dev mailing list