예제 #1
0
 private void patchLafFonts(UIDefaults uiDefaults) {
   // if (JBUI.isHiDPI()) {
   //  HashMap<Object, Font> newFonts = new HashMap<Object, Font>();
   //  for (Object key : uiDefaults.keySet().toArray()) {
   //    Object val = uiDefaults.get(key);
   //    if (val instanceof Font) {
   //      newFonts.put(key, JBFont.create((Font)val));
   //    }
   //  }
   //  for (Map.Entry<Object, Font> entry : newFonts.entrySet()) {
   //    uiDefaults.put(entry.getKey(), entry.getValue());
   //  }
   // } else
   UISettings uiSettings = UISettings.getInstance();
   if (uiSettings.OVERRIDE_NONIDEA_LAF_FONTS) {
     storeOriginalFontDefaults(uiDefaults);
     JBUI.setScaleFactor(uiSettings.FONT_SIZE / 12f);
     initFontDefaults(
         uiDefaults,
         uiSettings.FONT_SIZE,
         new FontUIResource(uiSettings.FONT_FACE, Font.PLAIN, uiSettings.FONT_SIZE));
   } else {
     restoreOriginalFontDefaults(uiDefaults);
   }
 }
예제 #2
0
 private void restoreOriginalFontDefaults(UIDefaults defaults) {
   UIManager.LookAndFeelInfo lf = getCurrentLookAndFeel();
   HashMap<String, Object> lfDefaults = myStoredDefaults.get(lf);
   if (lfDefaults != null) {
     for (String resource : ourPatchableFontResources) {
       defaults.put(resource, lfDefaults.get(resource));
     }
   }
   JBUI.setScaleFactor(JBUI.Fonts.label().getSize() / 12f);
 }