How to set the location of FontConfig for PDFNet usage?

69 views
Skip to first unread message

Ryan

unread,
Oct 23, 2018, 2:05:46 PM10/23/18
to PDFTron PDFNet SDK
Question:
How do I control where FontConfig is located?

Answer:

Windows

You can call PDFNet.SetPersistentCachePath() Before you call PDFNet.Initialize().

Other OS

You the environment variables that are impportant in this case are `FONTCONFIG_PATH` and/or `FONTCONFIG_FILE`. Fontconfig will use these to find the xml configuration file.

If only the path is defined, FontConfig will look for $FONTCONFIG_PATH/fonts.conf
Or, if both are defined and FONTCONFIG_FILE is relative, then  $FONTCONFIG_PATH/$FONTCONFIG_FILE will be used.
Alternatively, FONTCONFIG_FILE can be an absolute path (in which case FONTCONFIG_PATH is ignored)

In case you do not already have one, attached is a barebones config file that can be edited and placed in the configured location.
fonts.conf
Reply all
Reply to author
Forward
0 new messages