Repository navigation
Conversation
The mnemonic font size was derived only from the height of each row. On narrow cards
(eg. --card credit with --anonymous, which uses the larger "big" mnemonics), the
longest cell ("12 advocate": 2 digits, a space and an 8-letter word) was wider than
its column, so words ran into the next column or were clipped at the edge of the card.
Use the smaller of the height-based size and the size at which 11 monospaced
characters fit within 90% of the column width. Cards that already fit (eg. index)
are unchanged. On unmodified master, the longest cell overflowed for the credit card
(20, 33 and 59 words) and the photo card (33 words); the new test checks that every
card size and word count fits.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mnemonic font size was derived only from the height of each row. On narrow cards the longest cell ("12 advocate": 2 digits, a space and an 8-letter word) is wider than its column: words run into the next column or are clipped at the edge of the card. For example,
slip39 --card credit --anonymous(which uses the larger "big" mnemonics) overflows.This uses the smaller of the height-based size and the size at which 11 monospaced characters fit within 90% of the column width. Cards that already fit (eg. the index card) are unchanged.
slip39/layout/components.py(layout_card); constantsMNEM_CHARS,MONO_WIDTH,MNEM_FIT.test_card_mnemonics_fitinslip39/output_test.pychecks that the longest cell fits its column, for every card size and word count. On currentmaster, it overflows for the credit card (20, 33 and 59 words) and the photo card (33 words).pytest(without the invoice/communications tests): 42 passed, 4 skipped;recovery_test.py::test_dft_smokefails on Python 3.14 when numpy isn't installed (the pure-Pythonidftfallback), with or without this change.Before/after screenshots of
--card credit --anonymouscan be added.