support loading charsets
See original GitHub issueRefactor petmate to support loading in custom charsets. All of this refactoring would also be needed should petmate ever add support for drawing custom charsets.
To-do:
- Extend redux state to contain fonts.
- Perhaps they Framebuf field
charset
can be a key to workspace’s custom font data… Eg., right now it’supper
,lower
, but it could also be something likecustom_a
if the user loaded a custom font and named it that.
- Perhaps they Framebuf field
- Plug through enough state everywhere so that the lower level routines can get a font from the redux state with that charset name.
- Right now this is hardcoded to the two ROM fonts in getFontBits function. Should rename
getFontBits
togetROMFontBits
to separate it from the more general FBgetFontBits
that reads the redux state for the actual font data.
- Right now this is hardcoded to the two ROM fonts in getFontBits function. Should rename
- Change
saveWorkspace(filename: string, screens: number[], getFramebufById: GetFramebufByIdFunc, updateLastSavedSnapshot: () => void)
signature to get rid of the sillygetFramebufById
indirection.- Just pass in all the data directly that’s needed to save the workspace. Will need to pass in font data to this.
- UI for loading custom fonts, setting a name for them (or maybe just use custom_1, custom_2, etc. because… lazyness!)
- Save custom fonts along with a workspace
- Custom font selector under char select (there’s not enough horizontal space for more than one entry here… so maybe a dropdown selector or similar?)
- Rename fonts
- Delete fonts
- I don’t know how this should work if any existing screens use the deleted font?
- Charset
<select>
max width – can grow too large now with a long font name - Reloading fonts with some key shortcut
- This is not supported and probably will-not-fix for first release. Problem: doesn’t align well with how it’s implemented into Redux and workspace now. Once you load a font into Petmate, it loses any connection it had with the .64c font file.
- I’d prefer this type of thing to be handled by Petmate supporting font bitmap editing.
Should take every opportunity along the way to clean up import/export/load|saveWorkspace code as that really is kind of a mess.
Prompted by https://github.com/nurpax/petmate/pull/173
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Documentation: 15: 24.3. Character Set Support - PostgreSQL
The character set support in PostgreSQL allows you to store text in a variety of character sets (also called encodings), including single-byte character...
Read more >10.4 Connection Character Sets and Collations
The charset command issues a SET NAMES statement, and also changes the default character set that mysql uses when it reconnects after the...
Read more >Character Sets Supported - SingleStore Documentation
To view the list of character sets supported, run the SHOW CHARACTER SETS command. This will display the character sets along with their...
Read more >CHARACTERSET - Oracle Help Center
The CHARACTERSET parameter specifies a character set, other than the default, to use for the load. Syntax and Description. CHARACTERSET=character_set_name. The ...
Read more >HTML Character Sets - W3Schools
HTML Character Sets · HTML Character Sets · In the Beginning: ASCII · In Windows: Windows-1252 · In HTML 4: ISO-8859-1 · In...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m happy with this part of the UI that replaces the old ABC/abc buttons with a select box. IMO we don’t lose anything with this change as I’d imagine there’s usually no need to quickly switch between different charsets.
FYI @manuelvio @Esshahn
Here’s what I have so far:
This is with redux plumbing. And now Petmate supports the usual ROM fonts along with any custom fonts. There’s just not any UI yet to load fonts, save them, etc. But the ugly plumbing part is in reasonable shape.
If you have any thoughts on UI, always happy to hear suggestions. Right now I’m feeling sort of lazy in that this patch only supports adding new fonts but not modifying them (e.g., changing the charset name from custom_1 to sth else) or removing them once added into the workspace. I definitely want to support loading multiple custom fonts into the workspace. Because different screens can have a different custom font enabled.