Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Node mode hyphenates words after context sensitive glyphs have been chosen #284

Closed
SverreStausland opened this issue Sep 22, 2015 · 8 comments

Comments

@SverreStausland
Copy link

See http://tex.stackexchange.com/questions/262998/context-sensitive-glyph-appears-even-when-hyphenation-removes-the-context

I believe this is ultimately the same issue as in khaledhosny#43, which apparently is also caused by hyphenation happening after ligatures have been selected, rather than the other way around.

@eroux
Copy link
Member

eroux commented Sep 22, 2015

Would you have a MWE in ConTeXt? That would help bugreporting upstream (the code of luaotfload comes from ConTeXt).

@SverreStausland
Copy link
Author

Sorry, I have never used ConTeXt, so I wouldn't be able to make MWE for it.

@michal-h21
Copy link

I am not ConTeXt user either, so my MWE doesn't work as expected (ConTeXt doesn't support \parbox command and I don't know how to force line break in af-ter):

\usemodule[simplefonts][size=10pt]                                                                                         
\setmainfont[Alegreya]
\starttext
 Grafika after Tufte full                                                                                                    
\framed[width=0pt, frame=off, location=left]{for after }
\stoptext  

What's strange is that while long "f" is used in word "Tufte", it isn't used in "after" (even not in non-breaked word), as opposed to situation in LuaLaTeX, where long "f" is used in both cases.

Anyway, it seems that this long "f" isn't ligature, but it is selected with gsub feature. I think I've found the code responsible for handling this case, it is chainprocs.gsub_single function in luaotfload-fontloader.lua.

In this snippet:

    replacement=replacement[currentchar]
    if not replacement or replacement=="" then
      if trace_bugs then
        logwarning("%s: no single for %s",cref(kind,chainname,chainlookupname,lookupname,chainindex),gref(currentchar))
      end
    else
      if trace_singles then
        logprocess("%s: replacing single %s by %s",cref(kind,chainname,chainlookupname,lookupname,chainindex),gref(currentchar),gref(replacement))
      end
      current.char=replacement
    end

we can see that this feature replaces directly the character code of the matched glyph, so the linebreaking mechanism can't use the correct form in the case of word break. Maybe discretionary should be used instead?

@phi-gamma
Copy link
Member

The snippet in the tex.sx link above looks like this with the current fontloader:

This

@phi-gamma
Copy link
Member

@SverreStausland New release is out, please retest.

@SverreStausland
Copy link
Author

The new release is not available through texlive yet, so I'll need to wait
until it is.

On Wed, Dec 9, 2015 at 11:53 PM, Philipp Gesang [email protected]
wrote:

@SverreStausland https://github.com/SverreStausland New release is out,
please retest.


Reply to this email directly or view it on GitHub
#284 (comment)
.

@phi-gamma
Copy link
Member

···<date: 2015-12-10, Thursday>···<from: SverreStausland>···

The new release is not available through texlive yet, so I'll
need to wait until it is.

Of course =) This is just a reminder, take as long as you wish.

@phi-gamma
Copy link
Member

@SverreStausland ping

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants