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

font-base configuration setting not working as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.5
    • None
    • None
    • None
    • Tested on Windows, Linux

    Description

      When converting FO to PDF, FOP looks for fonts in the directory where the input FO file is located, not where <font-base> specifies.

      I use nightly builds since I need some new features. This problem did not exist in build 20130918, but it does in current builds (tested on 20131107).

      To reproduce (on windows, but the same procedure works on linux)

      1. Create a working directory (I used D:\Temp\fop)

      2. Take the attached config file (fop.xconf), and place it in the working directory. It contains: "<font-base>.</font-base>" so it should look for fonts in the directory where the config file is located.

      3. Download takao fonts from https://launchpad.net/takao-fonts/
      Extract TakaoPGothic.ttf into the working directory.
      Alternatively, use any other ttf font (just change config file).

      4. Download fop-20131107 nightly, and extract it to the working directory

      5. Take the attached FO file (in.fo) and place it another directory (i used D:\Temp\input) - it's important it's not located directly in the working directory.

      6. Open console, chdir to the working directory and run:
      fop-20131107\fop -c fop.xconf -fo D:\temp\input\in.fo -pdf out.pdf

      Expected:
      Conversion works

      Actual:
      Conversion breaks with error: java.io.FileNotFoundException: D:\temp\input\takao-pgothic.ttf (The system cannot find the file specified)
      Full stack in attached file error.txt.

      For some reason it's looking for fonts in the directory where the FO file is located.

      If you run the same scenario with v1.1 or an older nightly, this error does not happen.

      Attachments

        1. in.fo
          0.4 kB
          Ivan Habunek
        2. fop.xconf
          0.4 kB
          Ivan Habunek
        3. error.txt
          13 kB
          Ivan Habunek

        Activity

          People

            Unassigned Unassigned
            juice Ivan Habunek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: