[OSM-dev] OSM Mapnik Fonts are Nonsense
maw269 at gmail.com
maw269 at gmail.com
Tue Nov 2 21:14:43 GMT 2010
I am having issues rendering non-English Alphabet fonts from Mapnik for an
OSM world map tile server I am creating. I've done the research to no
avail. I must be missing something. I am using Mapnik 0.7.1 on windows
server 2008.
1. I have created a myOSM.xml stylesheet from the osm.xml template using:
generate_xml.py osm.xml myOSM.xml --dbname osm_planet --accept-none
--password pw --host localhost --port 5432 --user postgres
2. After creating the xml I then downloaded the Winzip unifont archive for
Mac and Windows from http://unifoundry.com/unifont.html
(http://unifoundry.com/unifont-5.1.20080907.zip ).
3. I uzipped this to:
C:\mapnik-0.7.1\lib\mapnik\fonts
4. I then went to C:\mapnik-0.7.1\inc\fontset-settings.xml.inc and
uncommented the unifont lines as such:
<!--Settings for Mapnik Fonts
Uncomment the unifont entries if you have that font installed
in your mapnik fonts dir, and want to use it as a fallback font.
Mapnik includes this font by default since r1328.
To see the fonts you have installed with Mapnik do:
ls `python -c "import mapnik;print mapnik.fontscollectionpath"`-->
<FontSet name="book-fonts">
<Font face_name="DejaVu Sans Book" />
<Font face_name="unifont Medium" />
</FontSet>
<FontSet name="bold-fonts">
<Font face_name="DejaVu Sans Bold" />
<Font face_name="unifont Medium" />
</FontSet>
<FontSet name="oblique-fonts">
<Font face_name="DejaVu Sans Oblique" />
<Font face_name="unifont Medium" />
</FontSet>
5. I then opened the myOSM.xml and noticed that it only had listed the
DejaVu fonts at the top. I then added the unifonts as such:
<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over"
bgcolor="rgb(181,208,208)">
<FontSet name="book-fonts">
<Font face_name="DejaVu Sans Book" />
<Font face_name="unifont Medium" />
</FontSet>
<FontSet name="bold-fonts">
<Font face_name="DejaVu Sans Bold" />
<Font face_name="unifont Medium" />
</FontSet>
<FontSet name="oblique-fonts">
<Font face_name="DejaVu Sans Oblique" />
<Font face_name="unifont Medium" />
</FontSet>
6. I then ran the following from the command prompt as suggested in
http://sajjad.in/mapping/setting-up-mapnik-for-rendering-tiles-in-your-language/:
python
>>> from mapnik import *
>>> for face in FontEngine.face_names(): print face
… [Enter]
It listed the 'unifont Medium' so I figured I was good to go.
7. I started to create tiles for the world using generate_tiles.py
All the letters in Eastern Europe, Asia, the Middle East, North Africa and
similar areas that don't use the english alphabet, are nonsense.
See http://d.imagehost.org/0402/OSM.png
Can someone please help me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20101102/b60d4a71/attachment.html>
More information about the dev
mailing list