How to set the location of FontConfig for PDFNet usage?

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 (170 Bytes)

配置了FONTCONFIG_FILE fonts.conf 并没有生效 linux 扩展的字体