FOP ttf metrics

Environment

  • YARG version:yarg-server-2.0-SNAPSHOT
  • Operating system: linux(docker)

FOP errors on converting docx to pdf

Font "Times New Roman,normal,400" not found. Substituting with "any,normal,400".
As i read, i need to generate ttf metric file for every font, using org.apache.fop.fonts.apps.TTFReader.
But in source code i can’t understand where i can place them, and where is fop configuration (for font registration) userconfig.xml

2019-02-07 21:05:29.258 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - Font "Times New Roman,normal,400" not found. Substituting with "any,normal,400".
2019-02-07 21:05:29.388 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - The contents of fo:region-body on page 4 exceed its viewport by 44611 millipoints. (See position 1:803)
2019-02-07 21:05:29.389 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - The contents of fo:region-body on page 3 exceed its viewport by 44611 millipoints. (See position 1:803)
2019-02-07 21:05:29.391 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - The contents of fo:region-body on page 2 exceed its viewport by 44611 millipoints. (See position 1:803)
2019-02-07 21:05:29.475 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - The contents of fo:region-body on page 1 exceed its viewport by 44611 millipoints. (See position 1:803)
2019-02-07 21:05:29.497 INFO  [qtp1509710854-15] org.docx4j.org.apache.xml.serializer.ToXMLStream - Using repackaged ToXMLStream
2019-02-07 21:05:29.498 INFO  [qtp1509710854-15] org.docx4j.org.apache.xml.serializer.ToXMLStream - Using repackaged ToXMLStream
2019-02-07 21:05:29.988 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
2019-02-07 21:05:29.988 WARN  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
2019-02-07 21:05:30.096 INFO  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - An fo:table  (See position 5:344) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
2019-02-07 21:05:30.191 INFO  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - An fo:table  (See position 9:98) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
2019-02-07 21:05:30.192 INFO  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - An fo:table  (See position 9:98) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
2019-02-07 21:05:30.381 INFO  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - Rendered page #1.
2019-02-07 21:05:30.395 INFO  [qtp1509710854-15] org.apache.fop.apps.FOUserAgent - Rendered page #2.

All fonts i get from ttf-mscorefonts-installer

Hi,

docx4j creates fop configuration programmatically. And there is no ability to modify fop configuration now, because YARG uses Docx4J#toPDF

We are going to modify YARG and setup FOP configuration.

And how can i resolve this problem now? May be store fonts in some special place?

1 Like