jelovirt / pdf-generator

DITA-OT PDF plug-in generator
https://dita-generator.elovirta.com/
Apache License 2.0
12 stars 5 forks source link

Allow custom font families #10

Closed dagoss closed 3 years ago

dagoss commented 7 years ago

It appears that the user cannot specific custom fonts for the various logical fonts that appear in font-mappings.xml

It would be nice to provide the ability to inject custom font families into this. The user could add one or more comma-separated font families for Sans, Sans-serif, and Monospaced, and these would be added to the beginning of the font-mappings for each.

As an aside, I tried putting in a font-mappings.xml myself and adding it to the catalog.xml, but it doesn't seem to get picked up. The catalog.xml that was generated for me was empty so I added this (with company replaced with the actual name):

<uri name="cfg:fo/font-mappings.xml" uri="fo/font-mappings.xml"/>

Is there something additional that needs to be done to get catalog.xml to get picked up?

EDIT: Removing this line from the integrator.xml that was generated fixed the problem so the font-mappings.xml (or the catalog--not sure what the issue was here) gets picked up.

<property name="pdf2.i18n.skip" value="true" />
jelovirt commented 3 years ago

The generated skips PDF2's I18N processing uses https://www.elovirta.com/2016/02/18/font-configuration-in-pdf2.html, so works as expected