mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8249215: JFrame::setVisible crashed with -Dfile.encoding=UTF-8 on Japanese Windows
Reviewed-by: prr, serb
This commit is contained in:
parent
13a335722f
commit
e15e30fef2
1 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -152,14 +152,18 @@ public final class WFontConfiguration extends FontConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the component font name (face name plus charset) of the
|
* Returns the component font name (face name plus charset) of the
|
||||||
* font that should be used for AWT text components. May return null.
|
* font that should be used for AWT text components.
|
||||||
*/
|
*/
|
||||||
public String getTextComponentFontName(String familyName, int style) {
|
public String getTextComponentFontName(String familyName, int style) {
|
||||||
FontDescriptor[] fontDescriptors = getFontDescriptors(familyName, style);
|
FontDescriptor[] fontDescriptors = getFontDescriptors(familyName, style);
|
||||||
String fontName = findFontWithCharset(fontDescriptors, textInputCharset);
|
String fontName = findFontWithCharset(fontDescriptors, textInputCharset);
|
||||||
if (fontName == null) {
|
if ((fontName == null) && !textInputCharset.equals("DEFAULT_CHARSET")) {
|
||||||
fontName = findFontWithCharset(fontDescriptors, "DEFAULT_CHARSET");
|
fontName = findFontWithCharset(fontDescriptors, "DEFAULT_CHARSET");
|
||||||
}
|
}
|
||||||
|
if (fontName == null) {
|
||||||
|
fontName = (fontDescriptors.length > 0) ? fontDescriptors[0].getNativeName()
|
||||||
|
: "Arial,ANSI_CHARSET";
|
||||||
|
}
|
||||||
return fontName;
|
return fontName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue