ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* manipulate ttf-fonts loaded with luatex
@ 2010-10-27 10:37 Ulrike Fischer
  2010-10-27 18:35 ` Aditya Mahajan
  0 siblings, 1 reply; 31+ messages in thread
From: Ulrike Fischer @ 2010-10-27 10:37 UTC (permalink / raw)
  To: ntg-context

Hello,

I'm currently a bit playing around with the idea to add some support 
in the (LaTeX) package "chessfss" (which handle chess fonts) for
fonts loaded with the luaotfload package. As luaotfload use the
context code to load the font I'm hoping that someone here can help
me with some of my problems.

Chess fonts are highly unstandard. The different authors of the
fonts did put the chars quite randomly in the character table and
also used various glyphs name. 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

So to be able to use ttf/otf-fonts directly I must "reorder" the 
glyphs in the fonts (without changing the original fonts).   

As a first step I was able to substitute glyphs with a .fea-file:

feature renc {
              substitute K by "glyph name of king";
         } renc;
 
But doesn't work all the time. E.g. the pirat font
(http://www.enpassant.dk/chess/downl/pirat.zip) 
shows already some on the problems of the project: The king with the
glyph name c140 is shown in fontforge on position 140 with a "å"
above. The å is shown on position 229 with an "Å". luaotfload seems
to think that there are two "aring" and so the temp-lua-file of the
font contains in the unicodes table the enrty "c140={ 229, 140 }"
and my substituation rule gets me an "å" instead of the King I want.

I get the correct substituation if I manually change the entry
"c140={ 229, 140 }" to "c140=140. 

So here the questions:

1. How can I make this change after the font has been defined? I
tried to find table entries which do contain this setting and change
them, but without luck. So either I didn't find the right table or I
need to execute some "reload" funktion. 

2. Is there another way to reorder the font than using .fea-files?
E.g. by changing some font entries? 

3. I can print the king by using its position with \char140. But how
can I print the king in a document by using its glyph name (c140)? 

4. Quite a lot chess fonts are incomplete. Is is possible to insert
glyphs from other fonts?



Btw:
The font Alfonso (http://www.enpassant.dk/chess/downl/alfonso.zip)
gives an error message. Probably the font is faulty somehow (I
wouldn't be surprised) but perhaps it also indicates a hidden bug,
so I'm mentioning it:

\documentclass{article}

\usepackage{luaotfload}

\begin{document}
\font\test={name:Chess Alfonso-X}
\test \fbox{K}
\end{document}

! LuaTeX error 
J:/MiKTeX2.9/tex/luatex/luaotfload/otfl-font-otn.lua:2398: table
 index is nil.
<to be read again> 
                   \test 


-- 
Ulrike Fischer 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2010-11-02 15:40 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 10:37 manipulate ttf-fonts loaded with luatex Ulrike Fischer
2010-10-27 18:35 ` Aditya Mahajan
2010-10-27 20:01   ` Ulrike Fischer
2010-10-27 21:32     ` Aditya Mahajan
2010-10-28  8:34       ` Ulrike Fischer
2010-10-28 12:33         ` Hans Hagen
2010-10-28 12:57           ` Ulrike Fischer
2010-10-28 13:08             ` Taco Hoekwater
2010-10-28 13:29               ` Ulrike Fischer
2010-10-28 13:33               ` Khaled Hosny
2010-10-28 14:59                 ` Hans Hagen
2010-10-28 15:37                   ` Ulrike Fischer
2010-10-28 16:01                     ` Hans Hagen
2010-10-28 17:08                       ` Ulrike Fischer
2010-10-28 17:17                         ` Hans Hagen
2010-10-28 17:48                           ` Ulrike Fischer
2010-10-28 18:56                             ` Hans Hagen
2010-11-02 15:16                               ` Ulrike Fischer
2010-11-02 15:40                                 ` Hans Hagen
2010-10-28 19:35                             ` Hans Hagen
2010-10-28 19:46                               ` Khaled Hosny
2010-10-28 20:29                                 ` Hans Hagen
2010-10-28 15:48                   ` Taco Hoekwater
2010-10-28 15:59                     ` Khaled Hosny
2010-10-28 16:06                       ` Hans Hagen
2010-10-28 16:29                       ` Hans Hagen
2010-10-28 16:47                     ` Ulrike Fischer
2010-10-28 17:03                       ` taco
2010-10-28 19:48                         ` Khaled Hosny
2010-10-28 13:10             ` Hans Hagen
2010-10-28 13:34               ` Ulrike Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).