mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-156246 About font on Windows is hardcoded to Tahoma, doesn't support some glyphs (Chinese)
This commit is contained in:
@@ -436,12 +436,27 @@ public class AboutPopup {
|
||||
private void renderWord(final String s, final int indentX) throws OverflowException {
|
||||
for (int j = 0; j != s.length(); ++j) {
|
||||
final char c = s.charAt(j);
|
||||
final int cW = fontmetrics.charWidth(c);
|
||||
if (x + cW >= w) {
|
||||
lineFeed(indentX, s);
|
||||
Font f = null;
|
||||
FontMetrics fm = null;
|
||||
try {
|
||||
if (!g2.getFont().canDisplay(c)) {
|
||||
f = g2.getFont();
|
||||
fm = fontmetrics;
|
||||
g2.setFont(new Font("Monospaced", f.getStyle(), f.getSize()));
|
||||
fontmetrics = g2.getFontMetrics();
|
||||
}
|
||||
final int cW = fontmetrics.charWidth(c);
|
||||
if (x + cW >= w) {
|
||||
lineFeed(indentX, s);
|
||||
}
|
||||
g2.drawChars(new char[]{c}, 0, 1, xBase + x, yBase + y);
|
||||
x += cW;
|
||||
} finally {
|
||||
if (f != null) {
|
||||
g2.setFont(f);
|
||||
fontmetrics = fm;
|
||||
}
|
||||
}
|
||||
g2.drawChars(new char[]{c}, 0, 1, xBase + x, yBase + y);
|
||||
x += cW;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user