fontspec icon indicating copy to clipboard operation
fontspec copied to clipboard

Use allocator for encoding names

Open wspr opened this issue 8 years ago • 2 comments

Something like

\newencoding\foo
\DeclareUnicodeEncoding{\foo}{...}

This would create a new TU* NFSS encoding name for each "logical name" \foo etc.

wspr avatar Jan 25 '17 05:01 wspr

I think this suggestion might have come from me originally, but...

I'm not sure it helps, if used in that way

looking at the use of a new encoding eg

http://tex.stackexchange.com/questions/349148/lualatex-is-not-rendering-%c5%a5-character-with-andika-new-basic-font/349154#349154

The name TUX needs to be unique (easy in a document, less easy if that was pushed to a package for setting up the font) but an allocator wouldn't help

\newencoding\TUX...

would just mean that the name \TUX had to be unique.

What might help if the allocator could completely anonymise the encoding name, something like

\declareusingnewunicodeencoding{ \input{tuenc.def}% load usual definitions \UndeclareComposite{\v}{t}% This variant has no ť \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} \setmainfont{AndikaNewBasic-R.ttf} }

which declares TU223 or whatever internally but then uses that for both the encoding definition and the font setup without having to show the encoding name anywhere.

perhaps...

davidcarlisle avatar Jan 28 '17 12:01 davidcarlisle

I see what you mean, but have labels for things been much of a problem up to this point? I also think you can do some other interesting things with labels that you couldn’t do anonymously, such as inheritance. It’s not out of the question we could have:

\DeclareUnicodeEncoding{TUx}{\InheritEncoding{TU}…}
\DeclareUnicodeEncoding{TUy}{\InheritEncoding{TUx}…}

I don’t plan on making any quick changes here, so I’ll keep mulling things over...

wspr avatar Jan 28 '17 13:01 wspr

I don't remember much about why this was logged originally and I don't think people have been clambering for an improvement so I'll close this one now

wspr avatar Apr 27 '24 07:04 wspr