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

Alignment of 「 is left instead of right #756

Closed
ElvenSpellmaker opened this issue Mar 21, 2018 · 5 comments
Closed

Alignment of 「 is left instead of right #756

ElvenSpellmaker opened this issue Mar 21, 2018 · 5 comments

Comments

@ElvenSpellmaker
Copy link

ElvenSpellmaker commented Mar 21, 2018

In mintty the alignment of the character seems to be to the very left of the cell in every font, but in other programmes this isn't the case and it's at the right of the cell:

mintty:
image

Word:
image

In this issue:
image

In Powershell ISE (shows as ? boxes in normal powershell):
image

Note: PS seems to treat it as single width, are the characters ambiguous width? Unless it's combining with the next char 🤔?

@mintty
Copy link
Owner

mintty commented Mar 21, 2018

U+300C LEFT CORNER BRACKET is a Unicode wide (not ambiguous-width) character. It should be centered within 2 character cells by the font already. I had noticed before that some wide characters have this unpleasant effect and I guess it's a font issue.

@mintty
Copy link
Owner

mintty commented Mar 24, 2018

It could be a combined effect with the Windows font fallback mechanism, i.e. the character may not be included in the selected font and then taken from another font.
Mintty has a mechanism already to expand a character glyph to the required character cell width, however it must be used with care, in order to avoid expanding wide glyphs again as once occurred (#570). An experimental workaround patch to include the two corner brackets in this mechanism works fine but we'll need to find a sustainable criteria which characters to cover by this expansion.
corner-brackets-expanded

@mintty
Copy link
Owner

mintty commented Mar 24, 2018

Actually, the Windows function to determine the glyph width does not seem to work in the font fallback case, so for a reliable workaround, we would need to measure the real rendered glyph width. This mechanism is also already available in mintty for some special situations (now applied to ambiguous-width characters, using a cache to tame the performance penalty).

@mintty
Copy link
Owner

mintty commented Mar 30, 2018

With the current version, matching CJK brackets are expanded if both are too narrow.
(Alternatively, it could be considered to right-align the left bracket.)

@mintty
Copy link
Owner

mintty commented Apr 12, 2018

Released 2.8.5.

@mintty mintty closed this as completed Apr 12, 2018
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

No branches or pull requests

2 participants