mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
306 stars 33 forks source link

Text in custom font has wrong encode is svg #147

Closed linsui closed 3 years ago

linsui commented 3 years ago

The tex file is

\documentclass[margin=3pt,dvisvgm]{standalone}

\usepackage{fontspec}

\begin{document}
\newfontfamily\arial{Arial}
\arial abcde
\end{document}

I generate the svg with

xelatex -no-pdf test
dvisvgm --zoom=-1 --exact --font-format=woff test.xdv

The result looks well, however if I copy the text from the svg I get ΤΥΦΧΨ. Pdf generated by xelatex is correct.

mgieseki commented 3 years ago

The issue is caused by an ambiguity in the mapping table that maps glyph indices to code points. It's easy to fix. I'm going to commit a patch shortly.

linsui commented 3 years ago

Thanks!