[NTG-context] accessing glyphs in the private area

Ulrike Fischer news3 at nililand.de
Mon Oct 1 11:42:26 CEST 2018


Am Mon, 1 Oct 2018 10:20:07 +0200 schrieb Hans Hagen:


> anyway, the problem, with these private areas is that they are also used 
> by the loader (and context) so in order to avoid clashes we move all 
> private chars in the font to a dedicated private range

This basically means that for every document and package which uses
the generic fontloader the access to chars in the private area with
\char is now broken in luatex (in xetex it still works fine).

I just got from Claudio Beccari (which seem to have complained to
Luigi) a bug report that the libertine fonts no longer show some of
the keyboard key glyphs due to the same problem. 

Can you tell me when this change happend? Perhaps I can build an
older fontloader as a fall back. 


> in your case the glyphs have no real useful names so basically i wonder 
> what their use it (are they meant for direct access?)

The question on tex.sx claimed that it has the name uniF58C. 
I never used the font and don't know how Therese accessed the glyphs
before, but the libertine package has long lists of mappings like
this:

\DeclareTextGlyphY{LinBiolinum_K}{uniE18C}{57740}

How do context users access such glyphs? Why is there no problem?


> you can define
> 
> \def\byindex#1{\ctxlua{
>      for k, v in pairs(fonts.hashes.identifiers[true].characters) do
>          if v.index == #1 then
>              tex.print(utf.char(k))
>              break
>          end
>      end
> }}
> 
> {\definedfont[Coelacanth] test \byindex{\number"00A33}}

I don't see a use of accessing this glyphs by index - index
positions can change if the font is updated. This can only be a last
resort for glyphs without unicode position.

The only sensible access is by unicode number (which works).
 

> I can remap those privates to a normalized private name, like P0F581 but 
> it depends on how bloated fonts become that have lots of privates.

> 
> In that case you can have:
> 
> \def\byname#1{\ctxlua{
>      for k, v in 
> pairs(fonts.hashes.identifiers[true].shared.rawdata.descriptions) do
>          if v.name == "#1" then
>              tex.print(utf.char(k))
>              break
>          end
>      end
> }}
> 
> {\definedfont[Coelacanth] test \byname {P0F581}}

It would at least mean that not the whole characters list must be
searched. And we could create a documented and stable access
command. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/



More information about the ntg-context mailing list