Hans,

some time ago, you provided me with the following code to hyphenate sha
with underscore:

  \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]

      \sethyphenationfeatures[sha]%
      \setuphyphenation[method=traditional]%

  \starttext
  \hsize\zeropoint
  \tt abcde
  \stoptext

I’m afraid that it isn’t working as expected with current latest from
2021.05.06 23:35.

I wonder whether this might be caused by a bug or the code should be
adapted to current latest.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to