diff -r -u mkgmap-trunk-org/resources/styles/default/lines mkgmap-trunk/resources/styles/default/lines --- mkgmap-trunk-org/resources/styles/default/lines 2009-04-03 16:41:48.000000000 +0200 +++ mkgmap-trunk/resources/styles/default/lines 2009-04-06 09:33:38.000000000 +0200 @@ -15,6 +15,11 @@ junction=roundabout & highway=unclassified [0x0c road_class=1 road_speed=2 resolution 21] junction=roundabout [0x0c road_class=0 road_speed=1 resolution 21] +# Add magic codes for highway symbols +highway=motorway {name '${ref} ${name}' | '${ref}' | '${name}' } +highway=trunk {name '${ref} ${name}' | '${ref}' | '${name}' } +highway=primary {name '${ref} ${name}' | '${ref}' | '${name}' } + # Set highway names to include the reference if there is one #highway=* {name '${name} (${ref})' | '${ref}' | '${name}' } highway=bridleway {add access = no; add bicycle = yes; add foot = yes} [0x16 road_class=0 road_speed=0 resolution 23] diff -r -u mkgmap-trunk-org/src/uk/me/parabola/mkgmap/reader/osm/Element.java mkgmap-trunk/src/uk/me/parabola/mkgmap/reader/osm/Element.java --- mkgmap-trunk-org/src/uk/me/parabola/mkgmap/reader/osm/Element.java 2009-04-03 16:41:42.000000000 +0200 +++ mkgmap-trunk/src/uk/me/parabola/mkgmap/reader/osm/Element.java 2009-04-05 23:29:19.000000000 +0200 @@ -94,7 +94,32 @@ } public void setName(String name) { - if (this.name == null) + if (this.name == null) { + this.name = name; + + // Symbols for highway graphics (8-bit): + + String sSymbMotorway = (char)0x04 + ""; + String sSymbHighwayLarge = (char)0x05 + ""; + String sSymbHighwaySmall = (char)0x06 + ""; + + // If the first character is a magic symbol.. + if (name != null && name.length() > 3 && name.substring(0,1) != null + && (sSymbMotorway.equals(name.substring(0,1)) | sSymbHighwayLarge.equals(name.substring(0,1)) | sSymbHighwaySmall.equals(name.substring(0,1)) )){ + + System.out.println("Magic char: " + name); + + // ... remove third character if it is a space. + // Changes "A 1" to "A1", etc. + // Needed because the graphic will only display characters up to the first space. + // ("A 1" would be displayed as only "A" in the graphic.) + if(" ".equals(name.substring(2,3))) { + this.name = name.substring(0,2) + name.substring(3); + System.out.println("No space: " + this.name); + } + } + + } } }