mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use non-bold font on splash screen (IDEA-163681)
This commit is contained in:
@@ -54,8 +54,6 @@ import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.Locale.ENGLISH;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@@ -105,7 +103,7 @@ public class DarculaLaf extends BasicLookAndFeel {
|
||||
// Text family should be used for relatively small sizes (<20pt), don't change to Display
|
||||
// see more about SF https://medium.com/@mach/the-secret-of-san-francisco-fonts-4b5295d9a745#.2ndr50z2v
|
||||
Font font = new Font(".SF NS Text", style, size);
|
||||
if (!Font.DIALOG.equals(font.getFamily(ENGLISH))) {
|
||||
if (!UIUtil.isDialogFont(font)) {
|
||||
return new FontUIResource(font);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,14 @@ public class Splash extends JDialog implements StartupProgress {
|
||||
final LicensingFacade provider = LicensingFacade.getInstance();
|
||||
if (provider != null) {
|
||||
UIUtil.applyRenderingHints(g);
|
||||
g.setFont(new Font(UIUtil.ARIAL_FONT_NAME, Font.BOLD, uiScale(Registry.is("ide.new.about") ? 12 : SystemInfo.isUnix ? 10 : 11)));
|
||||
|
||||
Font font = SystemInfo.isMacOSElCapitan ? createFont(".SF NS Text") :
|
||||
SystemInfo.isMacOSYosemite ? createFont("HelveticaNeue-Regular") :
|
||||
null;
|
||||
if (font == null || UIUtil.isDialogFont(font)) {
|
||||
font = createFont(UIUtil.ARIAL_FONT_NAME);
|
||||
}
|
||||
g.setFont(font);
|
||||
|
||||
g.setColor(textColor);
|
||||
final String licensedToMessage = provider.getLicensedToMessage();
|
||||
@@ -200,6 +207,11 @@ public class Splash extends JDialog implements StartupProgress {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected static Font createFont(String name) {
|
||||
return new Font(name, Font.PLAIN, uiScale(Registry.is("ide.new.about") ? 12 : SystemInfo.isUnix ? 10 : 11));
|
||||
}
|
||||
|
||||
private static float JBUI_INIT_SCALE = JBUI.scale(1f);
|
||||
private static float uiScale(float f) { return f * JBUI_INIT_SCALE; }
|
||||
private static int uiScale(int i) { return (int)(i * JBUI_INIT_SCALE); }
|
||||
|
||||
@@ -171,7 +171,7 @@ public final class FontInfo {
|
||||
if (font == null) {
|
||||
font = new Font(name, Font.PLAIN, DEFAULT_SIZE);
|
||||
// Java uses Dialog family for nonexistent fonts
|
||||
if (!Font.DIALOG.equals(name) && Font.DIALOG.equals(font.getFamily(ENGLISH))) {
|
||||
if (!Font.DIALOG.equals(name) && UIUtil.isDialogFont(font)) {
|
||||
throw new IllegalArgumentException("not supported " + font);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static java.util.Locale.ENGLISH;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
@@ -221,6 +223,10 @@ public class UIUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDialogFont(Font font) {
|
||||
return Font.DIALOG.equals(font.getFamily(ENGLISH));
|
||||
}
|
||||
|
||||
public enum FontSize {NORMAL, SMALL, MINI}
|
||||
|
||||
public enum ComponentStyle {LARGE, REGULAR, SMALL, MINI}
|
||||
|
||||
Reference in New Issue
Block a user