qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.39k stars 2.98k forks source link

Add label functions in field calculator #24291

Open qgib opened 7 years ago

qgib commented 7 years ago

Author Name: Reinhard Reiterer (Reinhard Reiterer) Original Redmine Issue: 16382

Redmine category:field_calculator


There should be a function in the field calculator that returns the hight/width of labels.

qgib commented 7 years ago

Author Name: Reinhard Reiterer (Reinhard Reiterer)


This would be quite helpful to create 'Geometry generator' based leader lines that are not covered by the labels:

@-- Geometry generator: make_line( make_point(label_x, label_y), $geometry)@

image

See also:

http://gis.stackexchange.com/questions/232709/creating-leader-lines-for-moved-labels

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


pjshelton commented 3 years ago

I think #37862 is asking the same thing.

m-kuhn commented 3 years ago

Copy pasting information from #37862

Add font metrics methods as expression functions

If you're thinking of adding this, you'll likely need to first create a new "render context" expression scope, since these metrics are all highly render context dependent.