Thursday, 21 June 2018

cartography - Relating text buffer to text size in QGIS?


I'm working with QGIS 2.16. When I create a map, I often use a white buffer around text of various size. The thing not evolving is the buffer size : the rendered text is sometimes a bit strange visually and the buffer is looking like it's not the same size on every text (even if it is if you mesure it). How to avoid this visual effect ?


Normal



Answer




  • Create a data defined field (Font_size) and set the font size in the label properties to be dependent on this field.


  • Create a virtual field (VRT_Buffer) with the following formula : to_real( "Font_Size") /15

  • Set the buffer size property to point towards this virtual field :


Buffer settings


You get a text with font size depending buffer, changing interactively when you change the font size with the label tools.


text with variable buffer


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...