The current support for the @font-face rule has a few issues:
- the
src property is not correctly parsed, because the code expects a single url function, but there can be others (like format):
|
public static class Src extends GenericURIWithNone { |
- the font file format is determined by the file extension, but the font url might not have a standard extension: the
format function should be the preferred method to determine the type, with fallback on file extension:
|
return lower.endsWith(OTF) || lower.endsWith(TTF) || lower.contains(TTC_COMMA); |
- there is no way to embed fonts if the
@font-face rule comes from an external @import (so no way to add -fs-pdf-font-embed: embed)
- given that there is no support for the
format function, probably it doesn't currently support the presence of multiple url with different formats, from which to choose the supported one
The current support for the
@font-facerule has a few issues:srcproperty is not correctly parsed, because the code expects a singleurlfunction, but there can be others (likeformat):OpenPDF/openpdf-html/src/main/java/org/openpdf/css/parser/property/PrimitivePropertyBuilders.java
Line 1562 in 3ddd942
formatfunction should be the preferred method to determine the type, with fallback on file extension:OpenPDF/openpdf-html/src/main/java/org/openpdf/pdf/ITextFontResolver.java
Line 286 in 3ddd942
@font-facerule comes from an external@import(so no way to add-fs-pdf-font-embed: embed)formatfunction, probably it doesn't currently support the presence of multipleurlwith different formats, from which to choose the supported one