MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / scaleDefaultFonts

Method scaleDefaultFonts

ij/src/main/java/ij/gui/GUI.java:348–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

346 }
347
348 private static void scaleDefaultFonts() {
349 if (!scaledMenu) {
350 var d = UIManager.getLookAndFeelDefaults();
351 for (var key : d.keySet()) {
352 if (key != null && key.toString().endsWith(".font")) {
353 var v = d.get(key);
354 if (v instanceof Font f) {
355 d.put(key, f.deriveFont((float) Math.max(1.0, f.getSize2D() * Prefs.getGuiScale())));
356 }
357 }
358 }
359
360 var ud = UIManager.getDefaults();
361 for (var key : ud.keySet()) {
362 if (key != null && key.toString().endsWith(".font")) {
363 var v = ud.get(key);
364 if (!Objects.equals(v, d.get(key)) && v instanceof Font f) {
365 ud.put(key, f.deriveFont((float) Math.max(1.0, f.getSize2D() * Prefs.getGuiScale())));
366 }
367 }
368 }
369
370 scaledMenu = true;
371 }
372 }
373
374 @AstroImageJ(reason = "Scale frames")
375 private static void scale(Component comp, double factor, Set<Component> processed) {

Callers 1

scaleFrameMethod · 0.95

Calls 7

getGuiScaleMethod · 0.95
keySetMethod · 0.80
toStringMethod · 0.45
getMethod · 0.45
putMethod · 0.45
maxMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected