nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
181 stars 14 forks source link

support custom character sets (incl. lower/uppercase ROM font) #90

Closed nurpax closed 5 years ago

nurpax commented 6 years ago

Petmate is currently hardcoded for the default uppercase charset from C64 ROM.

Should implement the necessary plumbing to be able to load in a custom charset (a bitmap file), to be able to select the lower/uppercase ROM charset and, ultimately, allow editing the charset within petmate.

A good first task here is to add lower/uppercase ROM charset. The plumbing required to make this work allows for plugging in custom charsets too.

Q: should the charset be global to all screens or selectable per screen? Certainly this information needs to be saved in the .petmate file and cannot be just an application setting.

Esshahn commented 6 years ago

Do you want to extend into the functionality tile map editors like CharPad offer? I'm by no means a pro, but it seems to me that there are two different scenarios when creating art

The main difference to me is that game art is mostly tile based and therefore needs proper tile management (which CharPad does). If Petmate wants to provide this, then having multiple charsets to be assignable to individual screens sounds like a great idea. Otherwise I think sticking to a single charset (for now) might be a simple but more than good solution.

nurpax commented 6 years ago

I don't plan to go into CharPad territory. Turning Petmate into a tile editor would be a huge undertaking and I like the tool as it is now because the UI is still really simple. (Or looks simple at least.) The CharPad direction would also require multicolor text mode support which Petmate doesn't support at all (and adding that support would be quite a lot of work.)

However, I've already received requests to add support for the C64 lower case charset (the one that contains a-z, A-Z and less other symbols.). Implementing this would require passing the charset bitmap through all the various layers and so adding "custom" charsets wouldn't really be any more complicated.

As for custom charsets.. what I had in mind that loading in other fonts (like any from http://kofler.dot.at/c64/font_01.html) would be quite useful for demo making. To layout some quick art for a loading screen etc.

Viza74 commented 6 years ago

Please add lowercase font, I need that feature like right now. :) I use petscii.krissz.hu now to be able to draw with lowercase. I liked petscii.krisz.hu before, but now I'm acustomed to petmate shortcuts :)

Ohh, I think a per screen setting would be the best

nurpax commented 6 years ago

I'll work on this next. This is better done earlier rather than later as it needs some plumbing work that will get harder to do later. I'll support just UPPER/lowercase charset selection for 0.4. Will see later if it will be extended for actually editing the charset (or loading charset binaries).

nurpax commented 5 years ago

@Viza74 look familiar?

screen shot 2018-08-23 at 11 57 29 pm

Need to steal a better char order from somewhere. I'll start working on this next.

Viza74 commented 5 years ago

Try http://petscii.krissz.hu/ the uppercase charset order in petmate is already the same as the one on krissz.hu, so maybe the lowercase should too :)

nurpax commented 5 years ago

Yep, that's not, erhm, an accident that they're the same :)

nurpax commented 5 years ago

I just checked in support for this. Here's how it looks like: https://youtu.be/96yFqlse-tw. @Viza74 please take a look and see that it makes sense to you.

I notice that painting is significantly slower now with this change (or some earlier change?). Need to track down what's causing that. I suspect it's doing unnecessary re-renders (that's quite an easy regression to make with React, arrow functions in props are one easy re-render source). Should be easy to fix.

Viza74 commented 5 years ago

The workings looks good, but ouch that seems slow...

Thank you for moving this forward in priority line, I'm doing petscii graphics for a BBS, and they use the lowercase charset, so I can't use petmate, and miss it :)

nurpax commented 5 years ago

Don’t worry, perf will be awesome soon. :)

nurpax commented 5 years ago

Performance now exceeds what it was before the custom charsets. It's really snappy now.

The only thing missing from this issue is a better character order for the lowercase font.

nurpax commented 5 years ago

Done. I'll send a test build for you @Viza74, if you have the time to try it out, would be great. Petmate 0.4 is really close to shipping. :)