FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

remove ui.font from prefs and to streamline font use · processing/processing4@899a717 · GitHub

Repository navigation

Commit 899a717

Browse files
committed
remove ui.font from prefs and to streamline font use
1 parent a97a000 commit 899a717

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

‎app/src/processing/app/platform/DefaultPlatform.java‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class DefaultPlatform {
6565
"CheckBox",
6666
"CheckBoxMenuItem",
6767
"ComboBox",
68+
"Label",
6869
"List",
6970
"Menu",
7071
"MenuBar",
@@ -80,6 +81,7 @@ public class DefaultPlatform {
8081
"Table",
8182
"TableHeader",
8283
"TextArea",
84+
"TextField",
8385
"TextPane",
8486
"TitledBorder",
8587
"ToggleButton",
@@ -115,14 +117,11 @@ public void setLookAndFeel() throws Exception {
115117

116118
// dummy font call so that it's registered for FlatLaf
117119
Font defaultFont = Toolkit.getSansFont(14, Font.PLAIN);
120+
UIManager.put("defaultFont", defaultFont);
118121

119122
// pull in FlatLaf.properties from the processing.app.laf folder
120123
FlatLaf.registerCustomDefaultsSource("processing.app.laf");
121124

122-
// defaultFont = 14 "Processing Sans", "Open Sans", "Noto Sans", Roboto, Arial
123-
//UIManager.put("defaultFont", "14 \"Processing Sans\", \"Open Sans\", \"Noto Sans\", Roboto, Arial");
124-
UIManager.put("defaultFont", defaultFont);
125-
126125
// start with Light, but updateTheme() will be called soon
127126
UIManager.setLookAndFeel(new FlatLightLaf());
128127

@@ -133,6 +132,7 @@ public void setLookAndFeel() throws Exception {
133132
}
134133
*/
135134

135+
/*
136136
// If the default has been overridden in the preferences, set the font
137137
String fontName = Preferences.get("ui.font.family");
138138
int fontSize = Preferences.getInteger("ui.font.size");
@@ -148,6 +148,7 @@ public void setLookAndFeel() throws Exception {
148148
// Font font = new Font(fontName, Font.PLAIN, fontSize).deriveFont(attributes);
149149
// setUIFont(new FontUIResource(font));
150150
}
151+
*/
151152
}
152153

153154
// // Adapted from https://stackoverflow.com/a/64667581/18247494
@@ -161,6 +162,7 @@ public void setLookAndFeel() throws Exception {
161162
// }
162163
// }
163164

165+
/*
164166
// Rewritten from https://stackoverflow.com/a/7434935
165167
static private void setUIFont(FontUIResource f) {
166168
for (Object key : UIManager.getLookAndFeelDefaults().keySet()) {
@@ -170,6 +172,7 @@ static private void setUIFont(FontUIResource f) {
170172
}
171173
}
172174
}
175+
*/
173176

174177

175178
public void setInterfaceZoom() throws Exception {
@@ -179,11 +182,14 @@ public void setInterfaceZoom() throws Exception {
179182
scaleDefaultFont(widgetName);
180183
}
181184

182-
String fontName = Preferences.get("ui.font.family");
183-
int fontSize = Preferences.getInteger("ui.font.size");
184-
FontUIResource uiFont = new FontUIResource(fontName, Font.PLAIN, Toolkit.zoom(fontSize));
185-
UIManager.put("Label.font", uiFont);
186-
UIManager.put("TextField.font", uiFont);
185+
// Font defaultFont = Toolkit.getSansFont(14, Font.PLAIN);
186+
// UIManager.put("defaultFont", defaultFont);
187+
188+
// String fontName = Preferences.get("ui.font.family");
189+
// int fontSize = Preferences.getInteger("ui.font.size");
190+
// FontUIResource uiFont = new FontUIResource(fontName, Font.PLAIN, Toolkit.zoom(fontSize));
191+
// UIManager.put("Label.font", uiFont);
192+
// UIManager.put("TextField.font", uiFont);
187193
}
188194
}
189195

‎build/shared/lib/defaults.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ platform.auto_file_type_associations = true
9595

9696
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9797

98-
# default font used for UI elements
99-
ui.font.family = Dialog
100-
ui.font.size = 12
98+
# default font used for UI elements (no longer in use as of beta 9)
99+
#ui.font.family = Dialog
100+
#ui.font.size = 12
101101

102102
# default size for the main window
103103
editor.window.width.default = 700

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL