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

Wrong font selection with awt (print)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 0.20.5
    • None
    • renderer/awt
    • None
    • Operating System: Windows 2000
      Platform: PC
    • 32391

    Description

      If I use a user defined font e.g Arial, that have more than one TTF file
      (arial.ttf, arialbd.ttf, ...), the font selection is wrong when I switch back
      from bold to normal.
      The first way (normal to bold) works fine, but the way back use the bold font
      file for the normal font.
      I located the problem in AWTFontMetrics.java::setFont(). The "Buffered font." f1
      in the source doesn't switch back to normal.
      The font family is equal, but the style is different, so that the line:
      f1 = f1.deriveFont(style, (float)s);
      select the wrong font (style bold, metrics normal (looks ugly) ).

      My local workaround was: disable caching, always create a new font.

      Thomas

      Attachments

        Activity

          People

            fop-dev@xmlgraphics.apache.org fop-dev
            th567892000@yahoo.de Thomas Heidler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: