Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
applied #10301 - extend display of maxspeed nodes (patch by Klumbumbus)
Include Droid Sans font in the JOSM binary distribution. This unifies the font rendering on different platforms and allows geometric constructions with text (as demonstrated for maxspeed). Both regular and bold style are available. git-svn-id: http://josm.openstreetmap.de/svn/trunk@7383 0c6e7542-c601-0410-84e7-c038aed88b3b
- Loading branch information
bastiK
authored and
bastiK
committed
Aug 13, 2014
1 parent
93df21b
commit 91bae7ba95dadfe7932c2d3d3ed448c34044dd97
Showing
11 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
BIN
+190 KB
data/fonts/DroidSans-Bold.ttf
Binary file not shown.
BIN
+186 KB
data/fonts/DroidSans.ttf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // License: GPL. For details, see LICENSE file. | ||
| package org.openstreetmap.josm.tools; | ||
|
|
||
| import java.awt.Font; | ||
| import java.awt.FontFormatException; | ||
| import java.awt.GraphicsEnvironment; | ||
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
| import java.util.Arrays; | ||
| import java.util.Collection; | ||
| import java.util.Map; | ||
| import org.openstreetmap.josm.io.CachedFile; | ||
|
|
||
| public class FontsManager { | ||
|
|
||
| public static Map<String, Font> fonts; | ||
| public static Collection<String> includedFonts = Arrays.asList( | ||
| "DroidSans.ttf", | ||
| "DroidSans-Bold.ttf" | ||
| ); | ||
|
|
||
| public static void initialize() { | ||
| GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); | ||
| for (String fontFile : includedFonts) { | ||
| String url = "resource://data/fonts/"+fontFile; | ||
| try (InputStream i = new CachedFile(url).getInputStream()) | ||
| { | ||
| Font f = Font.createFont(Font.TRUETYPE_FONT, i); | ||
| if (f == null) { | ||
| throw new RuntimeException("unable to load font: "+fontFile); | ||
| } | ||
| ge.registerFont(f); | ||
| } catch (IOException | FontFormatException ex) { | ||
| throw new RuntimeException(ex); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters