Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8190684

Multiple loaded versions of the same font results in wrong glyphs on OSX

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      java version “1.8.0_141”
      Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      macOS High Sierra

      A DESCRIPTION OF THE PROBLEM :
      My application uses an external library. This library bundles a font (Roboto) that it uses and loads. My application also bundles a version of this font that is loaded at startup, in the Application init() method.

      Text rendered on OSX using this font renders incorrectly -- in this case, every character seems to be rendered using the glyph for the next character. For example, "A" is rendered as "B", "B" as "C", and so on. The glyphs also appear to be using the computed sizes of the actual characters; a "w" is rendered as "x", but occupies the same amount of space as a "w"

      Screenshot: https://user-images.githubusercontent.com/6320992/32130908-5db3a4cc-bb6f-11e7-829b-61be52650733.png

      Note that this problem does not occur on Linux (tested with 1.8.0_121, Ubuntu) or Windows 10 (tested with 1.8.0_144)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      No longer using the version of the font bundled with the application seems to fix the issue. However, if multiple third-party libraries use different versions of the same font, this bug would most likely still appear.

        Attachments

        1. CustomFontExample.java
          1 kB
        2. roboto.jar
          825 kB
        3. roboto.thin.ttf
          125 kB

          Activity

            People

            • Assignee:
              pmangal Priyanka Mangal (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: