Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5154

Custom folder for fonts in FontMapper

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.23
    • Fix Version/s: 2.0.24, 3.0.0 PDFBox
    • Component/s: FontBox
    • Labels:
    • Environment:
      CentOS

      Description

      To find fonts the class that PDFBox uses is org.apache.pdfbox.pdmodel.font.FontMapper implemented by org.apache.pdfbox.pdmodel.font.FontMapperImpl and than going inside it uses org.apache.fontbox.util.autodetect.UnixFontDirFinder .

       

      org.apache.fontbox.util.autodetect.UnixFontDirFinder searches fonts in some hard coded directories.

       

      org.apache.pdfbox.pdmodel.font.FontMapperImpl is final and has default visibility so it's not visible from outside the package and can't be extended

       

      org.apache.pdfbox.pdmodel.font.FontMapper does not show setProvider method of the implementation so it's not possible to plug a custom FontProvider.

       

      Unfortunately CentOS puts fonts in /usr/share/X11/fonts/ that is not one of the specified folders of org.apache.fontbox.util.autodetect.UnixFontDirFinder .

       

      There should be a way to overcome this problem, maybe using a custom FontProvider, maybe extending FontMapperImpl to allow to develop a version with a custom FontProvider or something else.

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              qwertyscar Marco Scarpa

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment