Skip to content

Conversation

ronnodas
Copy link
Contributor

This is sort of related to #69 and #123 which fixed the header to say the height is 9 since that was true for most of the characters. But the last 7 of the 102 required characters had height 8 (as in the old incorrect header). These are all empty (as in have no subcharacters) and outside the ascii range (as in their characters codes) which is probably why this didn't show up in tests.

@peterbrittain
Copy link
Collaborator

Looks plausible to me. Probably should run a quick test... Do the other characters after this section display correctly now?

@ronnodas
Copy link
Contributor Author

I believe so from manual testing. I didn't figure out where/how the automated tests go.

@peterbrittain
Copy link
Collaborator

You can just run tests.py for the test suite (assuming you also have figlet installed). They won't test this case because not all fonts have control codes. In fact, after trying to add a test, I discovered figlet deliberately drops them!

@pwaller
Copy link
Owner

pwaller commented Jun 27, 2025

Please include what you did for manual testing in the body -- that makes it easier for me to understand what's happening.

@ronnodas
Copy link
Contributor Author

Please include what you did for manual testing in the body -- that makes it easier for me to understand what's happening.

Sorry, I misread the question. I had just checked that this change didn't mess up standard text.

For the characters after the change, it looks like the character codes don't really match the glyphs either, eg the ones tagged 26 and 27 should probably be 0x2264 and 0x2265 respectively.

@peterbrittain
Copy link
Collaborator

Yeah - I was trying to figure out the logic for the assignments, but these don't match anything I've seen in the past (e.g. codepage 437).

I've also discovered that pyfiglet cannot display them anyway - the current logic to load extended characters requires a hex index. Which is a happy coincidence, given that figlet ignores all control codes.

Suggest we delete these extended chars as they would never have been displayed by figlet.

@ronnodas
Copy link
Contributor Author

ronnodas commented Jun 28, 2025

Here are my best guesses for what these characters are supposed to be:

1 C001 -> 0x2666, possibly others
2 C002 -> ???
3 C003 -> 0x09
4 C004 -> 0x0C
5 C005 -> 0x0D
6 C006 -> 0x0A
7 C007 -> 0x25CB, many other choices
8 C010 -> 0x00B1
9 C011 -> 0x0A again?
10 C012 -> 0x0B
11 C013 through 25 C031 -> some subset of the box drawing block, 0x2500 -- 0x257F, but some choices here
26 C032 -> 0x2264
27 C033 -> 0x2265
28 C034 -> 0x03C0
29 C035 -> 0x2260
30 C036 -> 0x00A3
31 C037 -> 0x00B7, possibly others
127 C17 -> ???
0 C000 -> ???

Does pyfiglet handle the "0 = missing character" rule? If so, keeping the 0 might make sense.

@peterbrittain
Copy link
Collaborator

Nope. Pyfiglet will ignore missing characters instead.

@peterbrittain peterbrittain merged commit b40b87c into pwaller:main Jun 28, 2025
5 checks passed
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