diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-02-09 01:00:38 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-02-09 01:00:38 +0100 |
commit | f4c9d2d305f1214a144fcb23a66964761583234a (patch) | |
tree | e296f0ac0541d75729af1272346f30506405a6a4 /tex/context/base/mkiv/lang-hyp.lua | |
parent | 1687077b0a63417ad4dce58f6c869a6e115d9b72 (diff) | |
download | context-f4c9d2d305f1214a144fcb23a66964761583234a.tar.gz |
2018-02-09 00:12:00
Diffstat (limited to 'tex/context/base/mkiv/lang-hyp.lua')
-rw-r--r-- | tex/context/base/mkiv/lang-hyp.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/lang-hyp.lua b/tex/context/base/mkiv/lang-hyp.lua index 53a368b07..f73a51b3a 100644 --- a/tex/context/base/mkiv/lang-hyp.lua +++ b/tex/context/base/mkiv/lang-hyp.lua @@ -1042,6 +1042,7 @@ featureset.hyphenonly = hyphenonly == v_yes local extrachars = nil local hyphenchars = nil local language = nil + local lastfont = nil local start = nil local stop = nil local word = { } -- we reuse this table @@ -1404,6 +1405,8 @@ featureset.hyphenonly = hyphenonly == v_yes local skipping = false + -- In "word word word." the sequences "word" and "." can be a different font! + while current and current ~= last do -- and current local code, id = isglyph(current) if code then @@ -1411,7 +1414,8 @@ featureset.hyphenonly = hyphenonly == v_yes current = getnext(current) else local lang = getlang(current) - if lang ~= language then + local font = getfont(current) + if lang ~= language or font ~= lastfont then if dictionary and size > charmin and leftmin + rightmin <= size then -- only german has many words starting with an uppercase character if categories[word[1]] == "lu" and getfield(start,"uchyph") < 0 then @@ -1423,10 +1427,10 @@ featureset.hyphenonly = hyphenonly == v_yes end end end - language = lang - if language > 0 then + lastfont = font + if language ~= lang and lang > 0 then -- - dictionary = dictionaries[language] + dictionary = dictionaries[lang] instance = dictionary.instance characters = dictionary.characters unicodes = dictionary.unicodes @@ -1457,6 +1461,7 @@ featureset.hyphenonly = hyphenonly == v_yes else size = 0 end + language = lang elseif language <= 0 then -- elseif size > 0 then |