How does BuildVu handle fonts?
When creating PDF files, authors may choose which fonts to embed inside the PDF file.
Most PDF files contain embedded fonts because it ensures a consistent appearance across platforms, though it is also common to avoid embedding common fonts such as Times New Roman because it reduces the PDF filesize.
Some font licenses are permissive (such as SIL Open Font License), whilst other licenses are more restrictive. There is no reliable way to tell programmatically what license a font has. Many font licenses pre-date the internet, which means there is often no clear answer as to what is or is not allowed.
Some PDFs use Type 3 fonts, a special font type whose glyphs are defined using PDF drawing operations rather than a standard font program; see How does BuildVu handle Type 3 fonts? for how these are handled.
How fonts are handled in each text mode
BuildVu handles fonts differently depending on which Text Mode is used.
In shapetext_nonselectable modes, BuildVu draws the glyph shapes into the background layer, so no font file is written out. Text selection is not possible in this mode.
In shapetext_selectable modes, BuildVu draws the glyph shapes into the background layer in the same way, but also writes out a small, license-safe version of the font that is used for text selection purposes. This license-safe version contains only width information, with no usable glyph shapes.
In realtext modes, BuildVu writes out any embedded font files as part of the conversion. Fonts are output as WOFF by default (OTF is also available) and are subsetted to only the glyphs that are actually used, which keeps the file size down (most fonts in PDF files are already subsetted). The output font format can be changed using the includedFonts setting.
Fonts that are not embedded
When PDF files use fonts that are not embedded, BuildVu will use one of the following open-source fallback fonts: Liberation Serif, Liberation Sans, Noto Sans Condensed, Noto Sans Symbols2, Tex Gyre Cursor, GNU Unifont, Anton.
BuildVu selects the closest match for each font (the choice is made per font, not per glyph). It considers the font name, the flags declared in the PDF font descriptor (which indicate characteristics such as fixed-width or italic styling), the font metrics (used to detect narrow or light fonts), and whether the font is a CJK font.
Font file output
When embedded fonts are shared by multiple pages in the PDF file, BuildVu will only write out a single copy of the font.
If BuildVu writes out multiple font files with similar names it is because the PDF file stores different versions of the font with the same name or because the font maps multiple glyphs onto the same extraction value (which requires a new copy of the font).