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

Different fontname on macos

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • jfx16
    • javafx
    • None

      There are a number of ways fonts can be created on macos, and there is no consistency in naming.
      In MacFontFinder, all available fonts are retrieved as {name, family, file} blocks. For the name, the result of
      `CTFontDescriptorCopyAttribute(fd, kCTFontDisplayNameAttribute);`
      is used.

      This name acts as an identifier in a number of cases, e.g. in case of `LogicalFont.getSlotForFont(String fontName)`
      When the font is not yet loaded, it will be loaded via the constructor of `PrismFontFile` which will also interpret the file and set the different names. This is done in Java, and the retrieved value doesn't always match the original value obtained via

      `CTFontDescriptorCopyAttribute(fd, kCTFontDisplayNameAttribute);`

      As a consequence, the retrieved font is not considered the same as the requested one, and it will be put in the cache until that will overflow.

            prr Philip Race
            jvos Johan Vos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: