Feature request #4080

Html formatted labels

Added by Borys Jurgiel over 5 years ago. Updated 2 months ago.

Status:Open Start Date:07/14/2011
Priority:Normal Due date:
Assigned to:Nathan Woodrow % Done:

10%

Category:Map Canvas
Target version:Future Release - Nice to have
Platform: Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:

Description

In addition to expression based labels (#3488), it would be great to have a partial html formatting (e.g. <font size> <b> <i> <br> and <hr>)
Especially the horizontal line is often required:

some_field || '<hr/>' || another_field

HTML_Editor.jpg (28.7 kB) Azlan Budi, 05/07/2014 09:44 pm

htmllabels.png (22.7 kB) Nathan Woodrow, 02/28/2016 03:10 am

History

Updated by cgsbob - over 5 years ago

  • Pull Request or Patch supplied set to No

I'd also like to see a WYSIWYG editor like the Redmine editor I'm typing in now. Then you don't have to remember the markup language.

Updated by Pirmin Kalberer over 4 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Updated by Giedrius Vaivilavičius over 3 years ago

Make a bold or italic, and change the color of individual words Label. Example: the first line is bold in red text, font 12, second row 10 green italic font.

Updated by Antonio Locandro over 3 years ago

I agree this would be an useful feature, and also in combination with a WYSIWYG editor would make a powerful combo if possible

Updated by Azlan Budi almost 3 years ago

CKeditor like WYSIWYG editor on top of HTML formSomething like this in Map composer, where you can also do tables easily.
Probably a simplified version can be used in other function such as Text Annotation.

Updated by Mete Ercan Pakdil over 1 year ago

Hello there,

Last week I made a presentation about my paper titled "Smart Aeronautical Chart Management System Design" in GeoAdvances 2015, Kuala Lumpur.

In the "Questions" part of my presentation, a professor from UCL (unfortunately I don't remember her name) asked me "why not a open source GIS instead of ArcGIS". I explained that aeronautical charts need special labels and OS GIS apps do not have this functionality yet. The professor suggested me here to request this functionality.

Indeed, Borys Jurgiel already asked it but it is changed to "Nice to Have". However, this is very important in aeronautical charts. I beleive by using of HTML capabilities, we can produce charts in QGIS. Only two commercial apps from ESRI and Luciad can make it.

Paper: http://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/II-2-W2/index.html

Updated by Martin HOFFMANN about 1 year ago

A little up because this feature request just popped up again 5 days ago at GIS Stack Exchange
http://gis.stackexchange.com/questions/178680/different-styles-in-same-label

And for the record theses very similar questions are being up-voted on regular basis and still don't have satisfactory answers.
http://gis.stackexchange.com/questions/48389/how-to-create-a-label-combining-different-font-sizes-or-types?lq=1
http://gis.stackexchange.com/questions/64285/multiple-text-formats-in-a-qgis-label?lq=1

As I said in the latest thread, this is one of my last "damn ArcGis is still better on that" point...

Updated by Nathan Woodrow about 1 year ago

  • File htmllabels.png added
  • Assigned to set to Nathan Woodrow
  • % Done changed from 0 to 10

Work in progress

Updated by Martin HOFFMANN 6 months ago

Hello this seems partially implemented in 2.16.2

If I input this in the expression editor:

format('<h1>This</h1><b style="color: blue">%1 a %2</b>','is', 'test')

I can seen the formatted result preview in the expression editor but not in the canvas.
Is it normal? People may thing this is working while actually it is still in development...

Updated by mr twister 4 months ago

In 2.18.0 the formatted result is still in the preview of the expression editor but not in the canvas visible. This is a feature I have been waiting for a long time.

Updated by Harrissou Santanna 2 months ago

Hi,
mr twister wrote:

This is a feature I have been waiting for a long time.

Please, do not simply wait for it. Help devs make it a reality (there's already a work in progress at https://github.com/qgis/QGIS/pull/2856). If you are looking for it, you can advertise on it, (help) raise a funding/crowfunding on it and, given all interested people here (plus those who didn't express their interest), it might be doable.
See http://nyalldawson.net/2016/08/how-to-effectively-get-things-changed-in-qgis/

Also available in: Atom