question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support loading charsets

See original GitHub issue

Refactor 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’s upper, lower, but it could also be something like custom_a if the user loaded a custom font and named it that.
  • 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 to getROMFontBits to separate it from the more general FB getFontBits that reads the redux state for the actual font data.
  • Change saveWorkspace(filename: string, screens: number[], getFramebufById: GetFramebufByIdFunc, updateLastSavedSnapshot: () => void) signature to get rid of the silly getFramebufById 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:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nurpaxcommented, Nov 22, 2019

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.

image

1reaction
nurpaxcommented, Nov 19, 2019

FYI @manuelvio @Esshahn

Here’s what I have so far:

image

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found