mgieseki / dvisvgm

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

(question)WARNING: autohint functionality disabled (ttfautohint not found) #222

Closed povpie closed 10 months ago

povpie commented 1 year ago

When building through visual studio, I added a folder ttfautohint inside /vc and pasted the contents inside.

image

But autohint doesn't showup on visual studio:

image

When converting pdf to svg (dvisvgm --pdf -Oall -fwoff2,ah file.pdf) I get this error:

WARNING: autohint functionality disabled (ttfautohint not found)

I already added ttfautohint.dll in the same directory where the built dvisvgm.exe is.

mgieseki commented 1 year ago

WARNING: autohint functionality disabled (ttfautohint not found)

This means, dvisvgm can't find ttfautohint.dll in the Windows search path. To fix this, you just need to copy this file into a directory covered by the search path, for example the same folder dvisvgm.exe is located in (or any other folder listed when executing the path command). The ttfautohint dynamic library is not directly linked into the dvisvgm executable like the other libraries but kept as a separate file.

To build dvisvgm for Windows, you only need the header (.h) files present in ttfautohint\include. The DLL already comes pre-built as part of ttfautohint-1.8.4-dll64.zip. So it's not necessary to build it as part of dvisvgm and therefore I haven't added it to the Visual Studio project.

povpie commented 1 year ago

Hi Martin,

The ttfautohint.dll file which is inside ttfautohint-1.8.4-dll64.zip\bin is in the same folder where dvisvgm is. But I'm still receiving the error. (screenshot below) Do I need to rebuild the code in Visual Studio with (.h) headers from the zip file? Or is unnecessary as you commented?

dvi2

mgieseki commented 1 year ago

Could you please post the output of dvisvgm -V1 && where dvisvgm && where ttfautohint.dll && path?

Do I need to rebuild the code in Visual Studio with (.h) headers from the zip file? Or is unnecessary as you commented?

The header files of ttfautohint must be present in vc\ttfautohint\include. Otherwise the build process fails. Also, these .h files must be extracted from the same archive as ttfautohint.dll in order to ensure they use the same API version.

povpie commented 1 year ago

dvisvgm -V1 && where dvisvgm && where ttfautohint.dll && path dvisvgm 3.0.1 (x86_64-pc-win64)

brotli: 1.0.9 clipper: 6.2.1 freetype: 2.12.1 Ghostscript: 9.25 MiKTeX: 22.12 mutool: 1.21.0 potrace: 1.16 xxhash: 0.8.1 zlib: 1.2.13 C:\Users\danie\Downloads\dvisvgm-master1\dvisvgm-master\vc\x64\Release\dvisvgm.exe C:\Program Files\MiKTeX\miktex\bin\x64\dvisvgm.exe C:\Users\danie\Downloads\dvisvgm-master1\dvisvgm-master\vc\x64\Release\ttfautohint.dll C:\Users\danie\Downloads\ttfautohint-1.8.4-dll64\bin\ttfautohint.dll PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Calibre2\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MiKTeX\miktex\bin\x64\;C:\Program Files (x86)\gs\gs10.00.0\bin;C:\Users\danie\Downloads\mupdf-1.21.0-windows\mupdf-1.21.0-windows;C:\Users\danie\Downloads\ttfautohint-1.8.4-dll64\bin;C:\Users\danie\AppData\Local\Microsoft\WindowsApps;C:\Users\danie\AppData\Local\atom\bin;C:\Program Files (x86)\Brackets\;C:\Users\danie\AppData\Local\Microsoft\WindowsApps;

mgieseki commented 1 year ago

I can't really tell why dvisvgm doesn't find the DLL. Maybe something went wrong during the build. I suggest do delete the contents of \vc\ttfautohint, extract everything from the ttfautohint archive again and completely rebuild dvisvgm. Also, delete ttfautohint.dll from the directory where dvisvgm.exe is located in because there's already C:\Users\danie\Downloads\ttfautohint-1.8.4-dll64\bin\ttfautohint.dll. Ensure that this file is the same as the one in \vc\ttfautohint\bin.

povpie commented 1 year ago

I'll try to build again as soon as I have some free time and get back to you. Thanks Martin.