lualatex / luaotfload

OpenType font loader for LuaTeX
Other
26 stars 8 forks source link

typographic quotes ligaturing with ? #397

Closed davidcarlisle closed 7 years ago

davidcarlisle commented 7 years ago

Originally a user question on stackexchange

http://tex.stackexchange.com/a/351436/1090 enabling tex ligatures appears to set up ligatures with typographic quotes as well as the ascii ones which seems unexpected.

\input{luaotfload.sty}

\font\fa=[lmroman12-regular.otf]
\font\fb=[lmroman12-regular.otf]:+tlig

\fa 

U+2018 no tlig !‘

U+0060 no tlig !`

\fb

U+2018 tlig !‘

U+0060  tlig !`

\bye

produces ¡ for both of lines 3 and 4, which is unexpected and differs from the equivalent tex mapping of xetex which only produces ¡ on line 4.

I'm using

luaotfload | diagnose : Luaotfload revision 616b9077567fd670341696cb6ff2bfc71cf691a9.
luaotfload | diagnose : Committed by Philipp Gesang <phg@phi-gamma.net>.
luaotfload | diagnose : Timestamp 2017-01-29 20:52:03 +0100.

David

eg9 commented 7 years ago

If I comment out lines 1293 and 1294 in luaotfload-features.lua

1293 --            [0x00A1] = {0x0021, 0x2018},         -- exclamdown
1294 --            [0x00BF] = {0x003F, 0x2018},         -- questiondown

the result of the test file

\documentclass{article}
\begin{document}

endash: -- ; emdash: --- ; quotes: `` quotes ''

U+2018 no tlig !‘

U+0060  tlig !`
\end{document}

seems correct.

screen shot 2017-01-31 at 23 40 09

Using LaTeX2e <2017/01/01> patch level 1 so luaotfload is automatically loaded.

eg9 commented 7 years ago

By the way, also the ligatures

        [0x201C] = {0x2018, 0x2018},         -- quotedblleft
        [0x201D] = {0x2019, 0x2019},         -- quotedblright

seem wrong; XeLaTeX doesn't do them.

phi-gamma commented 7 years ago

enabling tex ligatures appears to set up ligatures with typographic quotes as well as the ascii ones which seems unexpected.

[…]

By the way, also the ligatures

        [0x201C] = {0x2018, 0x2018},         -- quotedblleft
        [0x201D] = {0x2019, 0x2019},         -- quotedblright

seem wrong; XeLaTeX doesn't do them.

Very interesting! Btw. these have been in the “tlig” set for a long time:

https://github.com/lualatex/luaotfload/blob/a34ba70ee4bf463c2ef499710bc319169c4d766b/otfl-font-otc.lua#L26 

and frankly I’ve been wondering why. Does this come closer to what you expect?

https://github.com/phi-gamma/luaotfload/commit/7250ac958d842f45d28220db87203506d3ae65c0#diff-953368baba679fc9279c9cac25b74051L1291

Thanks, Philipp