Git Product home page Git Product logo

Comments (5)

muzimuzhi avatar muzimuzhi commented on June 2, 2024 1

Looks like \automatichyphenmode=2 (defaults 0) works, but I don't know why.

The LuaTeX dvi outputs with \automatichyphenmode set to 0, 1, and 2 are already different, so the culprit might not be dvisvgm.

\documentclass{article}
\pagestyle{empty}
\def\testhyphens{%
  A-B\par
  -\par
  A-\hspace{0pt}B\par
  A-\par
  -B\par\bigskip}

\begin{document}
\automatichyphenmode=0
\testhyphens

\automatichyphenmode=1
\testhyphens

\automatichyphenmode=2
\testhyphens
\end{document}

Running

lualatex --output-format=dvi dvisvgm-gh255
dviasm dviasm dvisvgm-gh255.dvi > dvisvgm-gh255.dump

then in dvisvgm-gh255.dump

\automatichyphenmode=0 \automatichyphenmode=1 \automatichyphenmode=2
push:
  right: 77pt
  down: 63pt
  fnt: [...] at 10pt
  set: '\x1b"'
pop:
push:
  right: 77pt
  down: 75pt
  set: '@'
pop:
push:
  right: 77pt
  down: 87pt
  set: '\x1b@"'
pop:
push:
  right: 77pt
  down: 99pt
  set: '\x1b@'
pop:
push:
  right: 77pt
  down: 111pt
  set: '"'
pop:
push:
  right: 77pt
  down: 135pt
  set: '\x1b"'
pop:
push:
  right: 77pt
  down: 147pt
  set: '@'
pop:
push:
  right: 77pt
  down: 159pt
  set: '\x1b@"'
pop:
push:
  right: 77pt
  down: 171pt
  set: '\x1b@'
pop:
push:
  right: 77pt
  down: 183pt
  set: '@"'
pop:
push:
  right: 77pt
  down: 207pt
  set: '\x1b@"'
pop:
push:
  right: 77pt
  down: 219pt
  set: '@'
pop:
push:
  right: 77pt
  down: 231pt
  set: '\x1b@"'
pop:
push:
  right: 77pt
  down: 243pt
  set: '\x1b@'
pop:
push:
  right: 77pt
  down: 255pt
  set: '@"'
pop:

You can see the first and last line of each test group with \automatichyphenmode=2 are different from when \automatichyphenmode is set to other values.

from dvisvgm.

mgieseki avatar mgieseki commented on June 2, 2024

@muzimuzhi Awesome, thank you for the detailed analysis!

dvisvgm indeed converts the DVI files correctly. The initial one created by LuaTeX doesn't contain the missing hyphens so that dvisvgm can't process them.

from dvisvgm.

muzimuzhi avatar muzimuzhi commented on June 2, 2024

With lualuatex --output-format=dvi and \automatichyphenmode=(0|1), one also got

Missing character: There is no @ (U+0040) in font nullfont!
Missing character: There is no @ (U+0040) in font nullfont!

(\tracinglostchars=3 can be used to convert them into errors.)

from dvisvgm.

muzimuzhi avatar muzimuzhi commented on June 2, 2024

Turns out it's a luaotfload problem, see latex3/luaotfload#270. luaotfload maintainer Marcel Krüger has already kindly pushed a fix to dev branch, which you can test with locally by executing

git clone --branch=dev --depth=1 [email protected]:latex3/luaotfload.git
cd luaotfload
# needs l3build package
l3build install

cd /path/to/tex/files
# needs latex-base-dev and latex-bin-dev packages perhaps
# should be equivalent to "lualatex-dev --output-format=dvi"
dvilualatex-dev dvisvgm-gh255
dvisvgm --font-format=woff2 dvisvgm-gh255

from dvisvgm.

jeremy-engel avatar jeremy-engel commented on June 2, 2024

Great, thanks for the detailed explanation and for hunting down that luaotfload issue. I just confirmed that the dev branch for luaotfload does resolve this issue (and the problem I originally had that evolved into the MWE) as you said. I'll close this as the issue is in luaotfload and already fixed pending release. Thanks again.

from dvisvgm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.