bug with special hyphenation?
Dear list, I have been experiencing an issue with the new hyphenator for months (or maybe almost a year), but it took me a while to discover what was triggering it. First, the mandatory sample: \startluacode function document.addfunnyhyphen(tfmdata) local underscore = utf.byte("_") local char = tfmdata.characters[underscore] if not char then return end tfmdata.characters[0xFE000] = { width = 0, height = 0, depth = 0, commands = { { "right", -char.width }, { "down", char.depth }, { "slot", 1, underscore }, } } end utilities.sequencers.appendaction("aftercopyingcharacters", "after","document.addfunnyhyphen") local shared = { start = 1, length = 1, before = utf.char(0xFE000), after = nil, left = false, right = false, } local all = table.setmetatableindex({ }, function(t,k) return shared end) languages.hyphenators.traditional.installmethod("sha", function(dictionary,word,n) return all end ) \stopluacode \definehyphenationfeatures [sha] [characters=all, alternative=sha, righthyphenchar="FE000] \unexpanded\def\sha#1% {\begingroup\tt \sethyphenationfeatures[sha]% \setuphyphenation[method=traditional]% #1% \endgroup} \showframe \starttext some sha \sha{8b984688efec2}.\par \sha{8b984688efec2}\hskip0pt.\par {\sha{8b984688efe3a}\hskip0pt.}\par \stoptext Just in case you wonder, I need this to add SHA512 sums of attached files to PDF documents. (I have mixed the code from different samples that Hans gave me in replies to diverse questions.) If I use the \sha command right before a point, I get: - Only the first and the last character from the especially-hyphenated text are formatted with the monospaced font. The other ones are formatted with the Roman font. - The point outside the command is formatted with the monospaced font, instead of the Roman one. - It might be possible that hyphenation could behave wrong in this case. The simplest way to avoid the issue seems to be to use a zero-width space. Have I hit an issue with the new hyphenator, or am I simply missing somehting? Many thanks for your help, Pablo -- http://www.ousia.tk
On 2/8/2018 8:00 PM, Pablo Rodriguez wrote:
Have I hit an issue with the new hyphenator, or am I simply missing somehting? it's a border case that i'll look into
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 02/09/2018 12:03 AM, Hans Hagen wrote:
On 2/8/2018 8:00 PM, Pablo Rodriguez wrote:
Have I hit an issue with the new hyphenator, or am I simply missing somehting?
it's a border case that i'll look into
Many thanks for your fast fix in latest beta, Hans. Pablo -- http://www.ousia.tk
participants (2)
-
Hans Hagen
-
Pablo Rodriguez