I created a web app that generates a pdf. It works fine on my Windows machine, but it does not generate the pdf from my InMotionHosting VPS running Centos 7. The necessary fonts are in the /usr/share/fonts/times and /usr/share/fonts/liberation folders. InMotion support placed the liberation fonts on the server but neglected to do the times so I uploaded them. The liberation folder has three files that I do not have, fonts.dir, fonts.scale, and .uuid. I restarted the server after I added the times fonts, but the app still ignores the button that generates the pdf. Everything else seems to work fine. I am assuming it is a font issue as it works fine on my Windows machine both in the debugger and when compiled.
To see the current list of registered fonts:
To register new inserted fonts:
fc-cache -f -v
For DynaPDF, you may need to call AddFontSearchPath to add fonts for Linux.
The fonts seem to be in place and registered. I also copied them to the Resources folder which did not help. I am using the PDF feature built into Web 2.0. What else could keep the PDF from being generated?
fc-list | grep -i times
I changed the pdf on the web server to nothing but one graphic and it worked which pretty much says it is a font issue. fc-list revealed that the times font was already installed so I removed the files I had installed, reregistered, rebooted. Still does not work. times fonts are:
I see you have some duplicates. Remove the /usr/local/share/fonts/msttcore
fc-cache -f -v
Then show a small sample of you creating a PDF in Xojo that works with liberation but fails with times.
Make sure to use g.FontName = PDFDocument.StandardFontNames.Times
If it fails try g.FontName = "Times New Roman"
I removed the local fonts, then changed all the fontnames to times, then to liberationsans and liberationserif. Neither one worked. Will try Times New Roman next.
g.FontName = “Times New Roman” does not work either. Apparently Xojo does not recognize the path to the fonts. May have to move this app to a Windows computer in our office rather than a VPS.
Did you try calling the PDFDocument.AddFonts Shared Method?
Just FYI, renaming the font files doesn’t actually change the font names that they reference.