Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2554

FopConfig permits file URI for fonts only

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.0
    • None
    • font/unqualified
    • all flatforms

    Description

      config has following:

      <fonts>
      <font metrics-url="classpath:///fonts/arialuni.xml" kerning="yes" embed-url="classpath:///fonts/arialuni.ttf">
      <font-triplet name="arialuni" style="normal" weight="normal"/>
      </font>

      Exception on FontCache.java (line 335)
      File fontFile = new File(fontUri);
      My proposal:

      Instead:
      File fontFile = new File(fontUri);
      long lastModified = fontFile.lastModified();
      cachedFontFile = new CachedFontFile(lastModified);
      Write:
      long lastModified = 0L;
      if(fontUri.getScheme().equals("file"))

      { File fontFile = new File(fontUri); lastModified = fontFile.lastModified(); }

      cachedFontFile = new CachedFontFile(lastModified);

      This code is working.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              slay Mr. Povarnitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified