-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for rendering HTML based labels #2856
Conversation
🎉 |
do you have tests in case of malformed html? what would be the expected user experience?
sorry these are speculative questions... I'm not really a power user to decide what would be the better user experience. btw... big advance in rendering :) |
another question... where this tags will be exported in QML and SLD? as CDATA? |
@luipir there is no need for errors, etc. I just doesn't render correctly. Only a small subset of HTML is supported by QTextDocument so I don't see anything going wrong. Give this a try in a build if you have some ideas for testing bad data. It will be exported/imported using the same method as composer labels are which support full html (even more html then this) |
@luipir it gets stored as a string. Here is an example. This is just doing what we already do for labels.
|
This is a great feature! Thanks @NathanW2 Will it respect the previous definitions made by the user? For instance, if the user choose to use a certain font and then apply a H1 tag, will it keep the chosse font type, or will it apply other font type? |
you rock 👍 |
Well, this is a very important labeling feature that users will truly appreciate for 2.16 ! Thanks Nathan ! |
@3nids lets not go crazy now :) |
@SrNetoChan Yeah that was the plan I think. @nyalldawson thought we could just build up a default style sheet and set it using |
Nice! Thanks for this. If you guys add this to the legend, I will be your fan forever! (Bah... I will already be your fan forever no matter what. ) |
@SrNetoChan :) What do you mean the legend? |
I'm talking about the map composer legends. The ability to use HTML simple syntaxes, like bold and italic would be great. For instance, if the legend has species scientific names it's mandatory to have it in italic. |
Ah that is a cool idea. Maybe open a ticket for that. |
Really good! If it would include Composer Custom Coordinate labels, I would be a very happy camper! (Feature request #10301) |
In combination with some kind of stylesheet management this will be incredibly flexibel! Expression:
Style definition:
with features which have a |
What ever qtextdocument supports we can do On Wed, 2 Mar 2016 7:03 pm Matthias Kuhn notifications@github.com wrote:
|
... if we have a stylesheet management 😜 |
Just do this
|
Is there already something in place to setup the css rules? |
Why not just use project variables. wouldn't that work just as well and be On Wed, Mar 2, 2016 at 8:23 PM, Matthias Kuhn notifications@github.com
|
In your example the variable defines the class, but the rule for this class itself also needs to exist somewhere. |
Maybe like this:
|
Ah right yeah sorry. Let me get the basics in first then we can go crazy ;) On Wed, 2 Mar 2016 8:32 pm Matthias Kuhn notifications@github.com wrote:
|
Sure, that will be an enhancement, no requirement. It's already incredibly useful the way it is. |
This is exciting 💯 |
Merge it? |
Not in it's current state. I think I need some tests around it first at
least. I will see if I can get it done for 2.16 but not sure at this stage.
|
Closed after discussion with @NathanW2 . Needs someone else to pick this up and complete. |
Can we now add the new "Worth a revival" label to this? I know it's old but I just needed the feature and remembered the excitement this PR raised years ago... |
@nyalldawson : wouldn't HTML based labels be a good idea for one more northroadgeo crowdfunding? |
This PR adds support for reading HTML based labels
Opened for review
Things to complete:
[ ] Tests
[X] Fix position
[ ] Disable options not supported with HTML labels