mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 01:30:10 +00:00
7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
Reviewed-by: jgodinez, prr
This commit is contained in:
parent
accba3a5e1
commit
24043fa401
@ -37,6 +37,7 @@ import java.util.Vector;
|
||||
import javax.swing.plaf.FontUIResource;
|
||||
|
||||
import sun.awt.FontConfiguration;
|
||||
import sun.awt.HeadlessToolkit;
|
||||
import sun.lwawt.macosx.*;
|
||||
|
||||
public class CFontManager extends SunFontManager {
|
||||
@ -342,9 +343,14 @@ public class CFontManager extends SunFontManager {
|
||||
@Override
|
||||
public String getFontPath(boolean noType1Fonts) {
|
||||
// In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts
|
||||
if (Toolkit.getDefaultToolkit() instanceof LWCToolkit) {
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
if (tk instanceof HeadlessToolkit) {
|
||||
tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
|
||||
}
|
||||
if (tk instanceof LWCToolkit) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// X11 case
|
||||
return "/Library/Fonts";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user