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.
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.
- duplicates
-
JDK-8246104 Some complex text doesn't render correctly on macOS
- Resolved
- links to
-
Review openjdk/jfx/553