Skip to content

Add travel-sized deck layout (87x32mm) - #3530

Open
Mahaboobunnisa123 wants to merge 6 commits into
OWASP:masterfrom
Mahaboobunnisa123:feature/3483-travel-sized-deck
Open

Mahaboobunnisa123 wants to merge 6 commits into
OWASP:masterfrom
Mahaboobunnisa123:feature/3483-travel-sized-deck

Conversation

@Mahaboobunnisa123

@Mahaboobunnisa123 Mahaboobunnisa123 commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adresses part of #3483 by adding the requested "travel" size card profile (87x32mm).
To get this working, I added a new travel entry to pdf_config.yaml and created a dedicated landscape Scribus template (travel_master.sla).

What's changed:

  • It reuses the existing bridge-sized PNGs (asset_key: "small"). Scribus scales them automatically, so don't need to generate a whole new set of image files.
  • Since it's a narrow landscape format, the suit band runs horizontally across the top. The QR code and URL sit in the bottom right.
  • I bumped the base font down to 4.5pt so the attack text actually fits inside the smaller frame while staying readable up close.

Testing
I ran the generation scripts locally to verify the config and make sure nothing else broke. The engine successfully parses all 1,278 travel cards across all editions without warnings, and the existing bridge and tarot builds are completely unaffected.

Screenshot 2026-09-28 120609

PS D:\cornucopia\scripts\pdf_generation> python generate_deck.py --dry-run
Screenshot 2026-09-28 120647

Screenshot 2026-09-28 120709

Resolved or fixed issue: Addressed #3483

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

@Mahaboobunnisa123

Copy link
Copy Markdown
Collaborator Author

@rewtd @sydseter Let me know if you want me to do any adjustments/improvements

@Mahaboobunnisa123 Mahaboobunnisa123 self-assigned this Sep 28, 2026

@rewtd rewtd left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the travel size! I rendered the branch through Scribus (--edition webapp --language en --size travel) to check it, and the landscape layout has some problems that come from reusing the portrait bridge artwork.

Before: this PR as it stands (landscape, cropped to trim)

pr3530-before-landscape
  1. Artwork is stretched about 3.3x sideways. asset_key: "small" loads the portrait bridge art (804x1170) and the card back (602x877) into a 99x44mm frame, and place_artwork_frame scales to fill without keeping proportions. The bridge's vertical suit strip becomes a block across the left third of the card, and the back logo is distorted and cropped.
  2. Number cards lose their number. The pip value is drawn in the suit colour, which is the same colour as the stretched strip behind it (AT5's "5" is #6da7c3 on #6da7c3).
  3. The suit name is mostly unreadable. It is white, and only "AUT" lands on the strip. The suit band above it is mostly in the bleed, so very little survives trimming.
  4. Frames sit on or past the trim. Card number and attack text start exactly on the left trim line, and url_text ends at 252.4pt on a 246.6pt page.

Suggestion: make the travel card portrait

A portrait travel card (32x87mm trim) is the same height as bridge, just 24mm narrower, so the bridge template's vertical layout carries over almost unchanged. The attached patch (it applies cleanly to this branch's head) does that:

  • travel_master.sla is rebuilt from small_master.sla: page 90.71x246.61pt portrait, card border and back frames 44x99mm, text column 7mm to 30mm from the left trim, attack text frame taller (down to the QR code), Style_SpecialText line spacing 5.8pt, and the rotated suit name re-centred on the visible strip.
  • pdf_config.yaml: width_mm: 44, height_mm: 99, special_text_y_offset: 13, font sizes 4.8 / 5.0 / 4.6, and joker_label: "Jk".
  • generate_deck.py: one line, so a size profile's joker_label takes priority over the card's card value ("Joker" does not fit the narrow number frame).
  • pdf_generation_itest.py: three tests for the joker label override. All 28 tests in the file pass, and Black is clean.

After: with the patch (portrait, cropped to trim)

pr3530-after-portrait

Shown are AT5, C2 and AT6 (the two longest attack texts in the webapp deck), VEA (longest suit name, ace with special text) and both jokers. Everything fits with room to spare, numbers are visible, and suit names read down the strip as on bridge.

Still open

  • Artwork aspect ratio. Portrait still squeezes the bridge art about 1.55x horizontally. That's acceptable for the plain suit strip, but the back logo is visibly narrow, and the strip is only 4.3mm wide after trimming, so a small cutting error will make the suit name look off-centre. Dedicated travel artwork (asset_key: "travel" with <suit>-travel-default.png, <suit>-travel-court.png and back_of_card_travel_expanded_outlined_6mmbleed.png) would fix both, with no code change, because asset lookup already uses asset_key. The suit name frame would then need re-centring on the new strip.
  • joker_label isn't translated. It replaces the translated joker name, so every language shows "Jk". If that matters, it could be keyed by language.
  • Right margin is 2mm. That's tighter than bridge's 3.5mm. Worth checking against the printer's safe zone.
  • Not yet verified. These renders used Arial in place of Noto Sans (not installed on the rendering machine), and only English webapp cards were checked. Longer translations (ru, uk, hi) and the mobileapp and companion editions still need a render.

pr3530-portrait-travel.patch

@rewtd rewtd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review and apply the patch, merge master in and then look at the outstanding issues to see if you can correct those.

@Mahaboobunnisa123

Copy link
Copy Markdown
Collaborator Author

@rewtd thank you for reviewing, I will go through the suggestions.

@sydseter

Copy link
Copy Markdown
Collaborator

The back of the card will need a complete redesign. I'll see if I can have a look at it.

@sydseter

Copy link
Copy Markdown
Collaborator

@Mahaboobunnisa123 Can you move your branch over to the owasp/cornucopia repository. That way, I can more easily commit the artwork to it?

@Mahaboobunnisa123

Copy link
Copy Markdown
Collaborator Author

@sydseter I've pushed my feature/3483-travel-sized-deck branch to the official OWASP/cornucopia repository. The existing PR #3530 is still open. Now, you can be able to access the branch and commit the artwork. Please let me know if you encounter any issues.

@sydseter

sydseter commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

@Mahaboobunnisa123 I finished the /owasp_cornucopia_webapp_ver_cards_air_qr_lang.idml template and generated the pdf so that you get a better idea of the font sizes and format we are looking for. We should create similar templates for the companion and mobile edition. We'll keep the issue open until we have idml templates and scribus templates for all the 3 editions. See the attached PDF as a reference.

webapp-3.0-cards-air-en.pdf

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 this pull request may close these issues.

3 participants