-
Notifications
You must be signed in to change notification settings - Fork 816
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
Half and quadrant block elements are not aligned on the same grid #644
Comments
@DHowett I'm considering trying to quickly fix these, to have the half blocks and quadrants behave as proper mosaics, and make them align properly with octants, as some are reused as part of the octants set and currently don't align perfectly. I didn't want to include that in another PR to avoid mixing new glyphs and modifications to existing glyphs together. It would be some very small changes, just snapping their points to the unified grids. This would give a consistent set of mosaics for the people working on Terminal renderer to avoid them investigating or fixing alignments errors in the coming months that are actually caused by small misalignments in the font itself, and mean users hopefully will not experience misalignments with the new set of pseudopixels. I think I'll go ahead anyway in my personal repo copy so I can at least use that as a reference later, but if you are open to one more tiny PR, this would ensure we have a consistent set of mosaics for the coming months, as I understand Cascadia Next/Refresh will force quite a gap between releases. |
Go for it! The doors close tomorrow, and I haven’t actually shared the final release binaries for 2404.23 with anyone ;) |
I'm somewhat perplexed, and probably need some help, especially with the short deadline to get it merged. But if I build the NF variant and select that one in Terminal, then the new versions are used. To be clear, the overlap of the two different y values for the middle horizontal lines seen in the first screenshot above is fixed, but the characters seem to be stretched upward, making their middle horizontal separation higher than the same y value in characters I added such as the octants. Do you know what's going on? Is there some existing hinting that makes those characters render differently, or some special handling in Terminal for existing block characters? The version with updated coordinates is available on my repo: https://github.com/PhMajerus/cascadia-code |
Could it be the |
@DHowett Windows Terminal shows the normal version of Visual Studio editor, VS Code, conhost, and MS Word all use the stypo versions of both characters. The two character with red underline are the same, but the one with the up slope in the command is the normal version, while the one with the down slope in the error message is the stypo version. Can you clarify which version normal or stypo is expected to be used by Windows Terminal? I was under the impression that it was DWrite-based and that would use the stypo version? However, even the GDI API CreateFontIndirect seems to use stypo versions. Did I mix them up? I'm even more puzzled about Windows Terminal using the non-stypo Could there, be by any chance, a special handling of the classic block elements characters that could explain why they don't behave the same? Like some leftover code from when you were trying to make the characters that were supposed to fill the cell stretch to do so, and which uses a different code path, maybe not using DWrite to render these? More evidence of something being wrongExperimenting with Terminal Canary 1.21.240424002-llm, it seems to confirm my suspicions: The And to test it is not something I messed up, here is the same test, still running in Terminal Canary, but with the Cascadia Mono 2111.001 bundled with Terminal Preview from the Store, and with my test version of Cascadia Mono NF uninstalled. I believe the current Preview version crops characters that extend outside of their cell, but the Canary doesn't (which is a good thing), and so now we clearly see that the block elements have been extending too high, but were less noticeable before I fixed their coordinates because they actually used non-stypo coordinates and only moved points that were on the very top |
Seeing the behavior in Terminal Canary, it is clear to me the adjustments I performed are correct. They make the individual pseudopixels of mosaics / block elements equal sized. The reason they still don't align perfectly with my newer mosaics is some other issue. I actually noticed there was a problem years ago because Now with over 500 characters added in two PR, which I have been using for months, I'm confident my adjustments to glif files are correct, and Terminal Canary shows that there was a problem with the stypo substitutions of those characters since the very beginning. I'm going to go forward with a PR for those changes, as they don't make the situation worse and fixes the issue I originally documented in this thread. Later I'll document the issue in the Terminal repo as it seems to be something they might have to look into. |
This update adjusts the points coordinates of some previously existing blocks/mosaics characters to fit them in the same grid as used by octants and eights. This is required because the new octants and eights from Symbols for Legacy Computing do not duplicate existing patterns and expect those existing one to join perfectly with them to provide the whole set of all possible pseudopixels mosaics. This update verifies and adjusts the existing characters that are now required to join seamlessly with the extended pseudo-pixels mosaics introduced with the symbols for legacy computing. Some of the existing characters were not proper mosaics, most notably `▞`, where the two black rectangles overlap because they don't use the same y coordinates. This shouldn't happen as all the mosaics are supposed to fit precisely on a unified grid. Only a few characters required adjustments, but this PR also documents all the glyphs that have been checked to ensure alignments of all the mosaic characters. **BLOCKS:** `U+00A0` nbspace : already correct `U+2588` fullBlock & fullBlock.stypo : already correct (used as reference bounding rectangle for all pseudopixels mosaics) **HALF-BLOCKS:** `U+2580` upperHalfBlock & upperHalfBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+2584` lowerHalfBlock & lowerHalfBlock.stypo : already correct (confirming upperHalfBlock y=50% was wrong) `U+258C` leftBlock & leftBlock.stypo : already correct `U+2590` rightBlock & rightBlock.stypo : already correct **QUADRANTS:** `U+2596` lowerLeftBlock & lowerLeftBlock.stypo : already correct (confirming all other corrections above and below) `U+2597` lowerRightBlock & lowerRightBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+2598` upperLeftBlock & upperLeftBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+2599` upperLeftAndLowerLeftAndLowerRightBlock & upperLeftAndLowerLeftAndLowerRightBlock.stypo : already correct `U+259A` upperLeftAndLowerRightBlock & upperLeftAndLowerRightBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+259B` upperLeftAndUpperRightAndLowerLeftBlock & upperLeftAndUpperRightAndLowerLeftBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+259C` upperLeftAndUpperRightAndLowerRightBlock & upperLeftAndUpperRightAndLowerRightBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+259D` upperRightBlock & upperRightBlock.stypo : y=50% fixed from 707 to 873 (gdi) and 710 (stypo) `U+259E` upperRightAndLowerLeftBlock & upperRightAndLowerLeftBlock.stypo : Some y=50% fixed from 707 to 873 (gdi) and 710 (stypo), some were already correct `U+259F` upperRightAndLowerLeftAndLowerRightBlock & upperRightAndLowerLeftAndLowerRightBlock.stypo : already correct **OCTANTS:** `U+2582` lowerOneQuarterBlock & lowerOneQuarterBlock.stypo : already correct `U+2586` lowerThreeQuartersBlock & lowerThreeQuartersBlock.stypo : already correct **EIGHTS:** `U+2581` lowerOneEighthBlock & lowerOneEighthBlock.stypo : gdi was correct, y fixed from -183 to -182 (rounding unification for all Eights) for stypo `U+2583` lowerThreeEighthsBlock & lowerThreeEighthsBlock.stypo : y fixed from 534 to 535 (rounding unification for all Eights) for GDI, stypo was correct `U+2585` lowerFiveEighthsBlock & lowerFiveEighthsBlock.stypo : already correct `U+2587` lowerSevenEighthsBlock & lowerSevenEighthsBlock.stypo : y fixed from 1887 to 1888 (rounding unification for all Eights) for GDI, stypo was correct `U+2594` upperOneEighthBlock & upperOneEighthBlock.stypo : y fixed from 1887 to 1888 (rounding unification for all Eights) for GDI, stypo was correct `U+1FB83` upperThreeEighthsBlock & upperThreeEighthsBlock.stypo : from my PR #723 `U+1FB86` upperSevenEighthsBlock & upperSevenEighthsBlock.stypo : from my PR #723 `U+2589` leftSevenEighthsBlock & leftSevenEighthsBlock.stypo : already correct `U+258A` leftThreeQuartersBlock & leftThreeQuartersBlock.stypo : already correct `U+258B` leftFiveEighthsBlock & leftFiveEighthsBlock.stypo : already correct `U+258D` leftThreeEighthsBlock & leftThreeEighthsBlock.stypo : already correct `U+258E` leftOneQuarterBlock & leftOneQuarterBlock.stypo : already correct `U+258F` leftOneEighthBlock & leftOneEighthBlock.stypo : already correct `U+2595` rightOneEighthBlock & rightOneEighthBlock.stypo : already correct `U+1FB87` rightOneQuarterBlock & rightOneQuarterBlock.stypo : from my PR #723 `U+1FB88` rightThreeEighthsBlock & rightThreeEighthsBlock.stypo : from my PR #723 `U+1FB89` rightFiveEighthsBlock & rightFiveEighthsBlock.stypo : from my PR #723 `U+1FB8A` rightThreeQuartersBlock & rightThreeQuartersBlock.stypo : from my PR #723 `U+1FB8B` rightSevenEighthsBlock & rightSevenEighthsBlock.stypo : from my PR #723 This fixes the inconsistent alignments problem explained in issue #644, and ensures unified grid coordinates with PR #708 and #723. ## Validation Steps Performed Based on purely mathematical grid coordinates already used for octants, checked visually in VTT, Terminal Preview 1.20.10822.0 and Canary 1.21.240424002-llm, and Visual Studio editor. Note there is another related issue that impacts some of those characters, but this PR at least provides the correct glyphs and improves the situation. I believe the remaining alignment issue to be a problem in Terminal itself as it works perfectly in Visual Studio editor, and the original Cascadia Mono 2111.001 exhibits the same issue. More details about this in #644. Having the proper coordinates at least ensures they won't induce in error someone trying to fix the Terminal rendering and expecting the alignments to work with a font using inconsistent glyphs coordinates. A believe this PR to be a step in the right direction. Closes #644 Co-authored-by: Philippe Majerus <[email protected]>
Cascadia family version
2111.001
Cascadia family variant(s)
Cascadia Mono (the version without ligatures)
Font file format(s)
Windows Terminal included version (TTF (variable))
Platform
Windows 11 build 22621.382
Other Software
Windows Terminal 1.15.2003.0, but identical problem in the Windows Console (conhost).
What happened?
The block elements characters are supposed to be able to mix together to be used as pseudo-graphics.
The █ character fills the whole cell, the common ▀ and ▄ characters are half blocks, and ▌and▐ are left and right halves, but the less common quadrants should be aligned on the same grid, the whole set of 16 characters (with space or nbsp) should then provide all possible combinations of the 2×2 grid: ▖▘▌▗▄▚▙▝▞▀▛▐▟▜█.
Unfortunately, the alignment grid isn't the same for all those characters.
"\u2580\u2584\u2596\u2597\u2598\u2599\u259a\u259b\u259c\u259d\u259e\u259f"
The horizontal line splitting upper and lower halves should be identical for all those characters, basically always using the same 2×2 grid with each quadrant on or off like pixels, ideally splitting them evenly (perfectly centered).
For reference, here is the same sequence of characters using the UNSCII font (http://viznut.fi/unscii/):
Note some characters of this set are also shared to form the set of squot/sextant characters (2×3 grid), with U+1FB00..U+1FB3B of the Symbols for Legacy Computing. See #597 and #607.
It would make sense to rebuild them all as a single coherent set, all based on divisions of the reference █ full block character.
The text was updated successfully, but these errors were encountered: