lifelike / countersheetsextension

Inkscape extension for the layout of sheets of cards, tiles, or counters for boardgames.
Other
235 stars 27 forks source link

Images in Multiline Texts #93

Closed SeaBee44 closed 1 year ago

SeaBee44 commented 1 year ago

I know this shouldn't be possible, but here it is:

grafik

As mentioned in an issue before, the incoorporation of the Images leads to a larger space between lines. This seems to stem from a bigger "placeholder", as visible in the image above when marking the text. However, when selecting the image it looks like this:

grafik

So there are two issues here:

  1. The images themselves seem to be bigger than the upper case letters of the text
  2. In the background seems to be an ever bigger mysterious placeholder.

Any ideas?

lifelike commented 1 year ago

There is a known issue in the extension since Inkscape 1.0 that for some reason the square UNICODE glyph that was used as a placeholder would no longer work. As a temporary solution I got it to work by using X. That is not ideal and is probably the reason the placeholder is too tall in this case. That should be fixed. I do not see a GitHub issue for it, but there is one now I guess. You could try around line 650 to use some other character than X and see if that works better. But anything other than the square glyph is not good of course. I do not know how difficult it is to make that work as it should again.

lifelike commented 1 year ago

I noticed that the workaround with X instead of the proper SQUARE glyph actually included some code to try to calculate a square-shaped position for the image, so the image should be correct even if the X is not square. That part at least is correct.

But a side-effect is that the distance between lines is too large as you noticed, so it i still broken. Hopefully if the correct square symbol can be added back that will be less of a problem, but after a few quick attempts at adding it back still no luck.

SeaBee44 commented 1 year ago

Thank you for sending me in the right direction. I made it work for me. First i set the scaling for the placeholder to 100% in line 651, which was the reason for the increased space between lines. Which made my symbols very small.

So i switched the placeholder symbol from 'X' to 'nn', which made them just the right size. And finally i changed the Offset in Line 38 from 0.2 to -0.2 so my circles would line up nicer. Here is the result:

grafik

lifelike commented 1 year ago

I am adding options to set the size, offset, and placeholder for inline images. Perhaps a bit blunt to only have that as a global setting (future improvement to be able to set it per image?) but probably good enough for most projects.

SeaBee44 commented 1 year ago

This would definately be enough for my purposes. Thank you again.