latex3 / luaotfload

OpenType font loader for LuaTeX
Other
56 stars 6 forks source link

Why LuaLaTeX adds rot13 feature into any OpenType? #257

Closed AlphaJack closed 11 months ago

AlphaJack commented 11 months ago

From https://tex.stackexchange.com/q/666181/213962

"There's obviously no practical use for this; I'm guessing that it's there to help with testing the feature code."

https://github.com/latex3/luaotfload/blob/main/src/luaotfload-features.lua#L617-L638

zauguin commented 11 months ago

Not a bug

u-fischer commented 11 months ago

We don't know why the feature is there. The source code is imported from context but doesn't contain any comment about the purpose of the feature. I suggest that you ask on the context mailing list (https://wiki.contextgarden.net/Mailing_Lists). Perhaps there someone remembers why it was added.

zauguin commented 11 months ago

The rot13 feature is not part of the imported code but luaotfload specific. It was added in https://github.com/latex3/luaotfload/commit/a55edde26344366c385e433824d3e78fec618158 to demonstrate custom font features doing single char replacements.

u-fischer commented 11 months ago

The rot13 feature is not part of the imported code but luaotfload specific. It was added in a55edde to demonstrate custom font features doing single char replacements.

Oh, I thought it was already in the context files. Then we should really document it imho.

zauguin commented 11 months ago

Not sure how this best fits into the documentation. We could document what it does, but that wouldn't really help anyone since it's rather useless. AFAICT it was added to play around with substitution and then stayed in since there's basically no cost in having it there and it seems like a funny easteregg.

Maybe we should add the implementation as an example how to add a new substitution feature and then mention that it is already predefined? Or remove it from the code and only add it in the documentation as an example?

u-fischer commented 11 months ago

I would simply add a comment to source. If someone finds it there is an explanation, and for everyone else it is undocumented.

zauguin commented 11 months ago

Added in be130bb5.