defold-richtext icon indicating copy to clipboard operation
defold-richtext copied to clipboard

Add options to make images conform in scale to fit line height of previous or next char

Open subsoap opened this issue 4 years ago • 3 comments

Sometimes users may want to have emoticons in text and have them scale to be a part of a line to fit and not scale up the next line.

There should be options to scale up or not. That is if the image fits on the line without impacting the next line height, don't scale it down or up and leave it at is based scale.

If some text was made smaller, the image should get smaller with the line and scale to fit the text either before or after it if either don't exist.

subsoap avatar Aug 02 '20 03:08 subsoap

Another option would be to have the image not scale but also not impact the line height in any way.

subsoap avatar Aug 02 '20 06:08 subsoap

Good suggestion!

britzl avatar Aug 12 '20 09:08 britzl

What kind of syntax would be used for this?

-- url query format
<img=texture:image?scale=none&arg2=value2/>

-- comma separated
<img=texture:image,scale=none,arg2=value2/>

I'm leaning towards query format even though it is used differently here.

And what would the argument values be?

  • none = Do not adjust height of the image
  • fit = Scale image to fit height of text

There should probably also be an align property to say how the image aligns to the text vertically: "center", "bottom", "top"

britzl avatar May 04 '22 08:05 britzl