Changeset 5797 in josm
- Timestamp:
- 2013-03-22T23:47:54+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r5493 r5797 70 70 JPanel info = new JPanel(new GridBagLayout()); 71 71 JLabel caption = new JLabel("JOSM – " + tr("Java OpenStreetMap Editor")); 72 caption.setFont( new Font("Helvetica", Font.BOLD, 20));72 caption.setFont(GuiHelper.getTitleFont()); 73 73 info.add(caption, GBC.eol().fill(GBC.HORIZONTAL).insets(10,0,0,0)); 74 74 info.add(GBC.glue(0,10), GBC.eol()); -
trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
r5015 r5797 28 28 import org.openstreetmap.josm.gui.progress.ProgressRenderer; 29 29 import org.openstreetmap.josm.gui.progress.SwingRenderingProgressMonitor; 30 import org.openstreetmap.josm.gui.util.GuiHelper; 30 31 import org.openstreetmap.josm.tools.ImageProvider; 31 32 import org.openstreetmap.josm.tools.WindowGeometry; … … 64 65 // Add the name of this application 65 66 JLabel caption = new JLabel("JOSM - " + tr("Java OpenStreetMap Editor")); 66 caption.setFont( new Font("Helvetica", Font.BOLD, 20));67 caption.setFont(GuiHelper.getTitleFont()); 67 68 gbc.gridheight = 1; 68 69 gbc.gridx = 1; -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r5790 r5797 9 9 import java.awt.Dialog; 10 10 import java.awt.Dimension; 11 import java.awt.Font; 12 import java.awt.GraphicsEnvironment; 11 13 import java.awt.Image; 12 14 import java.awt.Stroke; … … 18 20 import java.awt.image.FilteredImageSource; 19 21 import java.lang.reflect.InvocationTargetException; 22 import java.util.Arrays; 23 import java.util.List; 20 24 21 25 import javax.swing.GrayFilter; … … 212 216 } 213 217 218 /** 219 * Gets the font used to display JOSM title in about dialog and splash screen. 220 * @return By order or priority, the first font available in local fonts: 221 * 1. Helvetica Bold 20 222 * 2. Calibri Bold 23 223 * 3. Arial Bold 20 224 * 4. SansSerif Bold 20 225 * @since 5797 226 */ 227 public static Font getTitleFont() { 228 List<String> fonts = Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); 229 // Helvetica is the preferred choice but is not available by default on Windows 230 // (http://www.microsoft.com/typography/fonts/product.aspx?pid=161) 231 if (fonts.contains("Helvetica")) { 232 return new Font("Helvetica", Font.BOLD, 20); 233 // Calibri is the default Windows font since Windows Vista but is not available on older versions of Windows, where Arial is preferred 234 } else if (fonts.contains("Calibri")) { 235 return new Font("Calibri", Font.BOLD, 23); 236 } else if (fonts.contains("Arial")) { 237 return new Font("Arial", Font.BOLD, 20); 238 // No luck, nothing found, fallback to one of the 5 fonts provided with Java (Serif, SansSerif, Monospaced, Dialog, and DialogInput) 239 } else { 240 return new Font("SansSerif", Font.BOLD, 20); 241 } 242 } 214 243 }
Note:
See TracChangeset
for help on using the changeset viewer.