Skip to content
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

<line> overflows narrow card widths #360

Closed
bszonye opened this issue Jan 26, 2022 · 1 comment · Fixed by #363
Closed

<line> overflows narrow card widths #360

bszonye opened this issue Jan 26, 2022 · 1 comment · Fixed by #363

Comments

@bszonye
Copy link
Contributor

bszonye commented Jan 26, 2022

When printing cards narrower than about 5 cm, the graphic overflows onto a second line. Looks like the problem is the fixed width of this substitution:

    # <line>
    replace = "<center>{}</center>\n".format("&ndash;" * 22)
    text = re.sub(r"\<line\>", replace, text)

Instead of a fixed 22 en dashes, it should probably have a maximum width of 4 dashes times the text width in centimeters.

Alternately, the code for labels suggests that 4 cm is the minimum useful width for card text, so you could also change the output to a static 16 en dashes, which appears to be narrow enough for that width.

@bszonye
Copy link
Contributor Author

bszonye commented Jan 26, 2022

I discovered that it's possible to determine the exact number of dashes that will fit on a line, so I've submitted a PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant