[NTG-context] accessing glyphs in the private area

Hans Hagen j.hagen at xs4all.nl
Tue Oct 2 14:42:11 CEST 2018


On 10/2/2018 1:39 PM, Ulrike Fischer wrote:
> Am Tue, 2 Oct 2018 11:29:46 +0200 schrieb Hans Hagen:
>>>   Can't you check for a free range instead?
>   
>> sure, but then i also loose some functionality in context (unless i gho
>> for ugly solutions) ... as all glyphs are supposed to have a name access
>> by name is a pretty good alternative
> 
> Well in my view name and code point are both valid and useful
> accesses (and I wouldn't trust names too much).
> 
> Beside this:
> xetex has (for non-legacy fonts) primitives for all accesses: by
> char (unicode), slot and name.

whatever ...

> luatex hasn't, here the only (primitive) access are commands like
> \char which expect a number; the name field of a character is marked
> as "unused" in the manual.

sure, as one can write lua code to provide that feature .. there is no 
benefit in having that code in the engine (in fact, even more could go)

> Neither has the generic fontloader imho some suitable primitive
> command for name access. All the examples in the generic folder uses
> numbers or direct input: e.g. \Uchar"1D49D or \Uradical "0 "221A

one can write these helpers ... i consider those things macro package 
dependent asd there's often some higher leel interface

> So it is imho quite natural that people who write code and packages
> expect the access by \char + code point to work. Why should I bother
> with a (perhaps font specific) glyph name if I can simply look up a
> clear code point number in a table?

ok, so it depends on the users and viewpoints of macro package writers 
.. if some extra glyph cannot be given a meaningful name it's probably 
not worth using anyway

> And if I got it right you are reserving a specific space to have
> stable numbers internally, so you are caring about numbers too ;-)

symbolic mapping and for text not hard coded (and shared therefore 
efficient) btu i shifted that space up and hope for the best (for 
context users that is, as i cannot test a lot now)

>> the main issue is that there are fonts that use private > 0xFFFF space
> 
> I don't know. Wikipedia says that code2000 uses plane 15 but I
> didn't check.

anyway ... i adapted the code to keep the pua intact and also added an 
option for outside context to keep bogus names ... (context users have 
several ways to access shapes anyway)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list