To solve this, I used DFontSplitter to extract Helvetica Light as a separate TTF file and added this as an embedded font to the style file:Īnd re-ran with -v which gave me this information: styles.py:276 Registering font: fonts/HelveticaLight from. This would seem to be because it couldn’t find a TTF file for the font on my Mac as Helvetica Light is stored in a dfont file. findfonts.py:329 Embedding via findTTFont as Īs can be seen by the output, rst2pdf can’t find Helvetica-Light and so has substituted Verdana instead. findfonts.py:317 Registering font: Verdana Bold Italic from /Library/Fonts/Microsoft/Verdana Bold Italic.ttf findfonts.py:317 Registering font: Verdana Italic from /Library/Fonts/Microsoft/Verdana Italic.ttf findfonts.py:317 Registering font: Verdana Bold from /Library/Fonts/Microsoft/Verdana Bold.ttf findfonts.py:317 Registering font: Verdana from /Library/Fonts/Microsoft/Verdana.ttf findfonts.py:308 Variants via findTTFont: findfonts.py:307 fname for findTTFont: Helvetica-Light findfonts.py:270 Trying to embed Helvetica-Light In this case, I discovered that setting stdFont: Helvetica-Light or stdFont: HelveticaLight in the style file resulted in Verdana being used in the PDF file!įortunately, the -v switch to rst2pdf is your friend when you want to know what’s happening: Note that to use fonts with rst2pdf, you need to install fontconfig using brew: brew install fontconfig Thank you.I wanted to use Helvetica Light in a PDF that I’m creating using rst2pdf and this proved a little tricker than I expected. If you redistribute a modified version of DfontSplitter, please prominently label that the project is modified, or use a different project name entirely. TODO can these be relative paths so this step can be avoided? Some paths in DfontSplitter.iss will need updating with the root of your project - OutputDir, SourceDir, InfoBeforeFile. However, even if you ported these fonts to your computer. Update the DfontSplitter.iss file with these entries. You could use for that one of the following tools : DfontSplitter (description), Macdisk,Fondu. This creates a Source entry for each of the FontForge distribution files and outputs this to fontforge-entries.txt. If you desire to use a new build of FontForge, (you will have updated the URL in Get-Fontforge.ps1), you may need to regenerate the list of items for the Inno Setup file to build the installer which includes all the files in the FontForge distribution.įor this, execute BuildTools\Get-FontForgeISSEntries.ps1. (A Build Event runs powershell -ExecutionPolicy bypass -Command Copy-Item -Recurse -Force "$(ProjectDir)\ExternalTools" "$(TargetDir)\ExternalTools" to copy FontForge components to the output directory.) FontForge and the Inno Setup installer file sln file in Visual Studio and build a debug or release version that will work correctly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |