Details
-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
-
14.1
-
None
-
Unknown
-
N/A
-
N/A
-
Description
In XWIKI-12877, font auto detection was disabled because "the initial goal was to only load what is in WEB-INF/fonts and we don't really need anything else by default.".
However, disabling auto-detect also prevents us from bringing new fonts from an extension and the only solution is to manually drop a file in the filesystem:
FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf: Manifest-Version: 1.0 Name: font/myfont.ttf Content-Type: application/x-font This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.
https://xmlgraphics.apache.org/fop/2.7/fonts.html#autodetect
It is not clear why loading the system fonts was a bad thing in the first place. Was it using too much RAM? Not being the original goal is not really a good reason.
It should be possible to write an extension that has a custom manifest that would make it visible to FOP. I am not sure about the classpath visibility level (EM classpath vs container/lib classpath). I have not tested this, but it would be a really nice improvement if it works, IMO, since manipulating the filesystem is not really nice (specially on a hosted deployment, where you don't have much control).
Attachments
Issue Links
- is related to
-
XWIKI-18423 Cambodian script is not supported by the FOP based PDF export
- Closed
-
XWIKI-18424 Sinhalese script is not supported by the FOP based PDF export
- Closed
-
XWIKI-18425 Uyghur script is not supported by the FOP based PDF export
- Closed
-
XWIKI-18426 Kannada script is not supported by the FOP based PDF export
- Closed
- relates to
-
XWIKI-12877 PDF export module load all system fonts
- Closed