[OSM-dev] Label font scaling

Stephan Knauss osm at stephans-server.de
Sun Jun 2 09:17:54 UTC 2013


Lynn W. Deffenbaugh (Mr) writes:

> Can you save me a bunch of research and just post an example of your  
> entity declarations (not necessarily all of them) and one or two  
> textsymbolizer instances that use them?

Maybe the scale_factor of mapnik2 can do the trick for you. My setup was  
originally done with 0.7 mapnik. I also wantet to increase everything by 1  
point. That can't be expressed by a single scale factor number.

Depending on which fonts you plan to use, be advised that with mapnik  
including the coming 2.2 there are unresolved issues with font rendering.  
You'll notice it when using multiline label or asian/indic characters.  
Solution would be to use the harfbuzz branch.

For my simple change I declared a set of new entities with straight-forward  
names to indicate what they usually represent:

<!ENTITY size_8 "9">
<!ENTITY size_9 "10">
<!ENTITY size_10 "11">
<!ENTITY size_11 "12">
<!ENTITY size_12 "13">
<!ENTITY size_13 "14">
<!ENTITY size_14 "15">


In the rules declaration these entity names are used:
     <Rule>
       <Filter>[amenity] = 'hospital'</Filter>
       &maxscale_zoom16;
       <TextSymbolizer size="&size_8;" fill="#da0092" dy="10" fontset- 
name="book-fonts" halo-radius="2" wrap-width="24"  
placement="interior">[name]</TextSymbolizer>
     </Rule>


This gives you a single place to increase the font size. If nobody  
complains I can submit this.

Stephan



More information about the dev mailing list