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

Fixes for half-blocks and quadrants, and new checkerboards #705

Closed
wants to merge 7 commits into from
Closed

Fixes for half-blocks and quadrants, and new checkerboards #705

wants to merge 7 commits into from

Conversation

PhMajerus
Copy link
Contributor

@PhMajerus PhMajerus commented Jan 11, 2024

Summary of the Pull Request

This is a very small update to prepare for unified mosaics, but it touches some existing glyphs.

The full block , half blocks (1×2 and 2×1) , and quadrants (2×2) are designed to be aligned on the same grid. Half blocks are used to complement the quadrants to get all possible 2×2 mosaics.
As explained in #644, there was a problem with some of these not being aligned on the same grid, preventing them from getting aligned properly when combined.
In preparation of sextants (2×3) and octants (2×4), as well as separated quadrants and sextants, this update uses a single set of coordinates for the subpixels of all mosaic characters.
This is the only pull request I have planned that requires changing existing glyphs, all the future ones only add new glyphs, so I pushed this one as a small one to make it easier to review as it probably requires more attention, the next ones will contain lot of glyphs, but based on programmed patterns.

References

This is the first and most difficult step towards providing the sextants as requested in #607, and octants discussed in #647.
While this update doesn't resolve either of these issues, it is the most difficult part to build a unified coordinates grid for all mosaics, which will then allow me to add the sextants and octants very quickly (they are ready, so I'm talking within days).

PR Checklist

Detailed Description of the Pull Request / Additional comments

Many of the existing half blocks and quadrants used y=707 for their vertical center. This has been changed to y=873 for GDI versions and y=710 for DWrite versions. This is geometrically correct considering their bounding boxes are respectively [0,2226},[1200,-480] and [0,1900],[1200,-480].
These new coordinates have been tested with other mosaic characters and render correctly.

This update also adds a few characters of the Symbols for Legacy Computing, especially interesting for terminals:

  • U+1FB95 Checker Board Fill (full block size)
  • U+1FB96 Inverse Checker Board Fill (full block size)
  • U+2427 Symbol for delete square checker board form (Apple ][ style)
  • U+2428 Symbol for delete rectangular checker board form (TRS-80 style)
  • U+2429 Symbol for delete medium shade form (Amstrad CPC style)

The two first ones are part of Unicode 13, while the 3 other ones have been accepted for Unicode 16 on 2022-Jan-26 (https://www.unicode.org/alloc/Pipeline.html).

Images of the Character(s)

image
Note the existing half-blocks and quadrants are now consistent, but seem to be a bit off, with their middle y separation too high. I'm not sure if Windows Terminal handles them as special cases, or if some hinting is involved and changes the pixels snapping.
For testing, I included U+1F67F and U+1F67E to be identical to U+259A and U+259E respectively, they are literally using <component base=.../> to reference the existing characters, and yet they render differently, they are properly separated in 4 equal parts while the quadrants are not.
To be able to include all mosaics, we really need all of them to be rendered similarly, half blocks and quadrants are used as sextants and octants to avoid duplicating existing characters.
So I suggest we update using the new coordinates and quickly add sextants and octants, and hopefully the Terminal team can unify how they handle all characters, or simply remove any blocks-specific code they added when Atlas wasn't able to render them well yet. The new characters that Windows Terminal doesn't handle as special case seem to render really well now.

Validation Steps Performed

Visual test on 100% and HDPI 200% displays, going through basically every zoom level using Ctrl+MouseWheel in Windows Terminal, and verified the glyphs in the built file using VTT.
I actually have sextants and octants built into a test version to verify how they all fit together and render. The pull requests are separated to make it more manageable to review the changes, but I have 386×2 other mosaic characters to submit.

Note the characters are not hinted, I wouldn't even know where to start, but they seem to behave similarly to the existing mosaic characters. They look great as it, I'm not sure whether simple geometrical shapes need hinting. Be careful though as all mosaics need to fit together, half blocks must align with quadrants, both must align with octants, half left and right must align vertically with all as well as with sextants, etc...
Whenever a new higher definition grid is introduced, they only include the missing pattern and reuse the equivalent existing patterns from existing lower resolution mosaics.

Philippe Majerus added 6 commits January 11, 2024 04:51
These have been approved for publication in version 16.0 (https://www.unicode.org/alloc/Pipeline.html)
They are documented in the Terminals Supplement (https://www.unicode.org/L2/L2021/21235r-terminals-supplement.pdf)
They are located in the Control Pictures characters block, but are part of the characters added to handle Symbols for Legacy Computing.
Glyphs design by Philippe Majerus based on Cascadia Code characters and full block dimensions, and original Apple II, TRS-80, and Amstrad CPC computers character set.
This doesn't add any character, but fixes the rendering issue for previously added checkerBoardDeleteAmstradCpc.
The middle y coordinate was 707 for both versions, instead of 873 for GDI, and 710 for DWrite.
Most quadrants had the middle y coordinate at 707 for both versions, instead of 873 for GDI, and 710 for DWrite.
Adds U+1F67E and U+1F67F (Ornamental Dingbats) using existing quadrants. These will be changed to character-sized versions later.
Adds U+1FB95 and U+1FB96 4x4 block-sized checkerboards (Symbols for Legacy Computing)
Final touch before pull request.
@PhMajerus
Copy link
Contributor Author

PhMajerus commented Jan 11, 2024

@aaronbell
I didn't succeed in refactoring the quadrants files and settled for just fixing the coordinates they use in the existing files.
The next mosaics (for next pull requests) are a lot of glyphs, so I used the same convention as the Unicode documentation, with a prefix to define which set of mosaics it is and a suffix to specify which pseudo-pixels are on, using a string of numbers where each pseudo-pixel has its own number and the sequence stays short and very easy to identify.

The sextants will be blockSextant-[digits], where digits are taken from the following grid:

+---+---+
| 1 | 2 |
+---+---+
| 3 | 4 |
+---+---+
| 5 | 6 |
+---+---+

And the octants will be blockOctant-[digits], where digits are taken from the following grid:

+----+----+
|  1 |  2 |
+----+----+
|  3 |  4 |
+----+----+
|  5 |  6 |
+----+----+
|  7 |  8 |
+----+----+

I wanted to refactor the quadrants similarly to make it easier to handle all mosaics, as follows:

+-+-+
|1|2|
+-+-+
|3|4|
+-+-+

upperLeftBlock -> blockQuadrant-1
upperRightBlock -> blockQuadrant-2
lowerLeftBlock -> blockQuadrant-3
lowerRightBlock -> blockQuadrant-4
upperLeftAndLowerRightBlock -> blockQuadrant-14
upperRightAndLowerLeftBlock -> blockQuadrant-23
upperLeftAndUpperRightAndLowerLeftBlock -> blockQuadrant-123
upperLeftAndUpperRightAndLowerRightBlock -> blockQuadrant-124
upperLeftAndLowerLeftAndLowerRightBlock -> blockQuadrant-134
upperRightAndLowerLeftAndLowerRightBlock -> blockQuadrant-234

But I ran into errors and couldn't find where the script referenced the older names.
While this is not required for my next submissions, I would recommand going that route when you work on the great overhaul.

@PhMajerus
Copy link
Contributor Author

PhMajerus commented Jan 11, 2024

Here's a test to confirm the new coordinates are right, showing sextants using the same pseudo-pixels grid:

image

Also a nice demo of what can be achieved with sextants and VT colors.


And here's a test of the unified mosaics coordinates used for quadrants, sextants, and octants:

image

curl https://raw.githubusercontent.com/PhMajerus/ANSI-art/main/Unicode/Blocks%20tables.txt

@PhMajerus
Copy link
Contributor Author

I'll include a characters picture in the next pull request, but here is an overview of what I have planned.
This pull request contains the first blue set of characters. Other groups show more quadrants, sextants, octants, separated quadrants and sextants, seven-segment digits, and large type pieces.
All of these are par of the legacy computing blocks.

cascadia-code-legacycomputing-characters

@PhMajerus
Copy link
Contributor Author

After some more days of testing with a custom build, it seems the quadrants with the old coordinates align better with the new ones I have prepared.
I don't know why using all the same coordinates doesn't work, there must be something else tweaking those glyphs.

I'd still recommend we modify them to use the same coordinates for all mosaics for better maintainability, but I'll close this pull request and start over with one that only provide new glyphs, leaving the existing ones as they are for the meantime.

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.

Half and quadrant block elements are not aligned on the same grid
1 participant