Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support limiting symbols to a particular vintage character set #110

Open
kimslawson opened this issue Sep 16, 2022 · 10 comments
Open

Support limiting symbols to a particular vintage character set #110

kimslawson opened this issue Sep 16, 2022 · 10 comments
Labels
feature New feature or request

Comments

@kimslawson
Copy link

It would be a nice addition to chafa to support restricting the characters used to a subset corresponding to a particular computer's character set (for example, PETSCII, ATASCII, Apple II, etc.) While the vintage class to symbols and fill is nice, it's not specific enough... If I'm making ATASCII art, I don't want it to include characters that aren't supported by the Atari's limited character set.

I'd like to see classes corresponding to the individual computer/terminal types, so as to limit the output to that particular character set. (for example --symbols=ATASCII, --fill=PETSCII)

Specifically, characters from each supported character set class would need to be mapped to the appropriate unicode points, and those sets assigned to individual symbol classes. Unscii is a font that might help with this endeavour, as well as displaying the output in a terminal, as it faithfully tries to recreate the pixelated character sets of many retro platforms.

(Related closed issue here)

@hpjansson
Copy link
Owner

Yes! I actually want to implement a --preset (-P) option for this with built-in presets for vintage platforms. I've made rudimentary starts for C64 and IBM/VGA/cp437. A little more groundwork needs to be laid so it can also emulate the various color palettes.

@kimslawson
Copy link
Author

Awesome!

Screen Shot 2022-09-16 at 11 43 32

This is what I get when I test using unscii-8 right now, but for example ATASCII has no support for many of those glyphs.

@hpjansson
Copy link
Owner

Nice Workbench 1.3 vibes :-)

By the way, you can specify individual glyphs by passing their hex codes to --symbols, e.g. --symbols 20,30..39, but it's obviously pretty tedious.

@kimslawson
Copy link
Author

Nice Workbench 1.3 vibes :-)

Ha. I was going for Atari mode 0 but I got the luminance wrong.

@kimslawson
Copy link
Author

This is what I get when I test using unscii-8 right now, but for example ATASCII has no support for many of those glyphs.

Screen Shot 2022-09-16 at 12 29 13

of course I haven't had enough coffee, because I got that command wrong. THIS is what it should look like with it restricted to legacy (I had it mixed up with "vintage" which is a nonexistent class)

Relevant still is that some of those are not supported by certain systems. So the point still stands :)

@hpjansson
Copy link
Owner

Indeed.

I'd love to have some help with the research. For instance, I'd accept a PR with an ATASCII table similar to the ones I did for C64/cp437. Or maybe there needs to be more than one table -- I'm not sure what the differences are between the Atari 400 and later models.

@kimslawson
Copy link
Author

similar to the ones I did for C64/cp437

I had a look around the code and docs, but didn't see this. Can you point me in the right direction?

@hpjansson
Copy link
Owner

Ah sorry, I linked to the source files in #110 (comment). They're not used for anything yet, but it's useful to keep adding those so I can integrate them later.

@hpjansson hpjansson added the feature New feature or request label Jan 31, 2023
@clort81
Copy link

clort81 commented Feb 5, 2023

This is what I get when I test using unscii-8 right now, but for example ATASCII has no support for many of those glyphs.

Screen Shot 2022-09-16 at 12 29 13

of course I haven't had enough coffee, because I got that command wrong. THIS is what it should look like with it restricted to legacy (I had it mixed up with "vintage" which is a nonexistent class)

Relevant still is that some of those are not supported by certain systems. So the point still stands :)

Amazingly, Viznut failed to add the eight glyphs that would be needed to emulate PETSCII triangles in half-width (common aspect ratio) monospace fonts. For that I made 8 glyphs with double-wide triangles, so that Blapinus has glyphs with 45 degree angle triangles.

@clort81
Copy link

clort81 commented Mar 8, 2023

A HUGE THANK YOU to hpjansson for now restricting chosen glyphs to those contained in the --glyph-file !

/usr/local/bin/chafa --color-space=din99d --color-extractor=median -p on --symbols all --glyph-file /usr/share/fonts/X11/misc/blapetscii-12.pcf.gz -w 8 -s 80 redcrab-ihasfloppy.png

Now i can limit the glyphs used from my real font (blapinus) by creating a font containing only the glyphs I want! But... that's a lot of work to create and install a font just to limit the glyphs chafa pulls from!

Would anyone consider a patch that reads-in a list of glyph codepoints from a text file, and ONLY uses those?

Without the --glyph-file it is impossible for me to set the range that I want explicitly on the command line, using, for example

chafa --symbols none, u2580 u2584 u258c u2590 u2595 u25AE uE000..uE07F uEB4D..uEB92 uEC15..uEC18  redcrab-ihasfloppy.png

Fails to include the codepoints I add. It seems to select a few... (?). But none in the PUA range?

There ought to be a way for user to specify the exact codepoint ranges to use upon invocation and not get overriden by inscrutable internal program range-selection logic, without creating an entire new font every time he wants to adapt the selection of glyphs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants