The text layout code passes a boolean flag down to the native layer which is used to inform it how to handle device scales. For sun.font.TrueType instances this is a cheap test, but since on MacOS the CFont class is used, the call is very expensive on Mac, since it makes a native call which uses core text to retrieve the table and constructs a Java byte array and passes it up to Java. All to discover the layout technology of the font. If this can't be made much cheaper, the result should be cached.
|