dominiontabs icon indicating copy to clipboard operation
dominiontabs copied to clipboard

Rules text with images are not properly justified

Open mbbush opened this issue 8 months ago • 3 comments

For certain cards with a combination of words and images (vp, coins, etc) in the rules text, when they're rendered horizontally, some lines extend outside of the expected area. It's something related to how reportlab renders justified text lines containing an image, but I'm not sure if the issue is with reportlab or with how this project uses it.

dominion_dividers.pdf

I used the following cards in my example:

  • Possession
    • Small font size, a line ending with an image overhangs
  • Remake
    • A line with large spaces ending with an image overhangs
  • Workshop
    • A line with large spaces ending with a word overhangs
  • Ritual
    • A line with large spaces and 2 images ending in a word overhangs
  • Fool's Gold
    • Works perfectly, but seems like it shouldn't
  • Fisherman
    • First line with two images ending in an image overhangs
  • Bishop
    • A line with two images ending in an image overhangs
  • Monument
    • Actually bleeds off of margin

Command line to reproduce: dominion_dividers --orientation vertical --cardlist debug.list --front rules --back none with debug.lst containing the names of the cards above, one on each line.

mbbush avatar May 07 '25 18:05 mbbush

Screenshot to help folks see the issue: Image

Just a guess but maybe the art assets don't get justified in the same way as the text.

nickv2002 avatar May 08 '25 05:05 nickv2002

@sumpfork looks like this got automatically closed when you merged #575, but it's not actually fixed.

I think there's a good chance the actual issue is with reportlab, but this provides a good example of the issue. Could you please reopen it?

mbbush avatar May 26 '25 16:05 mbbush

The issue is definitely in reportlab. I've got a local patch which fixes it.

mbbush avatar Jun 06 '25 22:06 mbbush