-
Notifications
You must be signed in to change notification settings - Fork 510
Add text overflow option in badge designer #6944
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
Add text overflow option in badge designer #6944
Conversation
e732ba9 to
dad10ab
Compare
| let fontSize = item.font_size; | ||
| fontSize = parseFloat(pattern.exec(fontSize)[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| let fontSize = item.font_size; | |
| fontSize = parseFloat(pattern.exec(fontSize)[1]); | |
| let fontSize = parseFloat(pattern.exec(item.font_size)[1]); |
|
Is the ellipsis option going to be useful for badges? It seems no better than truncating. Maybe just wrap and resize is enough? |
I added the ellipsis since this was a setting so we could add different options but I can remove it if no one thinks it's useful. I didn't understand "seems no better than truncating" as there is no truncating option. |
501ee52 to
27ed8d0
Compare
|
Ah I thought truncating was the default, disregard my comment :) I'd only add the resize option (and keep the wrap option) unless someone needs the ellipsis as well. |
|
The ellipsis option has been removed. |
indico/modules/designer/pdf.py
Outdated
| return color | ||
|
|
||
| def _get_resized_font(self, content, font_size, font_name, width): | ||
| min_font_size = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a try and 4 is pretty much unreadable. What about using 6 as the minimum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact the minimum selectable size in the badge editor is 7. I don't have a strong opinion on whether to go for 6 or 7 as the minimum though. But maybe when going for 6, it shouldalso be the smallest selectable size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I went with 6 as the minimum.
6184aea to
ac0aa86
Compare
ac0aa86 to
a349e95
Compare
This PR adds an option in the badge designer for dealing with overflowing text: To either wrap (already the default), resize or add ellipsis to the text.
E.g Given this badge design:

Changing the text_overflow option for the "Event Title" and "Fixed text" as example, the resulting badge should look like:
Wrap option:

Resize option:
