-
Notifications
You must be signed in to change notification settings - Fork 181
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
Handle surrogate pair for unicode >= U+10000 #616
Comments
In general, mintty does handle surrogate pairs, but there may be a gap in the code for handling combining characters, which might hit also non-combining characters in certain cases. To be checked. |
Checking again, I don't think the musical symbol alone can trigger the loop for the combining case that you patched (did you trace?). Although you have made a valid point, I guess your symptom is more likely explained by missing font support. Did you try option |
Somehow (to be checked), all non-BMP characters seem to be getting handled by the combining characters code branch, so your patch does indeed stabilise non-BMP display (would have worked a while, than break mysteriously). Changing and further investigating. |
Thanks for looking into this issue. I tested my patch and it fixed the display for me. I used the Windows 10's seguisym.ttf ( -o 'Font=Segoe UI Symbol' ) which covers, among other characters, both latin1 and the music symbol G clef U+1D11E. NotoSansSymbols-Regular.ttf ( -o 'Font=Noto Sans Symbols' ), available at https://www.google.com/get/noto/ HanaMinA.ttf ( -o 'Font=HanaMinA' ), available at Per your instruction, I also tested the option '-o FontRender=uniscribe'; the music G clef symbol was For the music G clef symbol tests: For the CJK characters tests: |
For the records, and in case you're interested:
|
Eliminated one remaining quirk in surrogate handling (they were not considered for the bounding rectangle when drawing the character, yielding blanks and cursor artefacts especially when editing). |
Fixed in 2.7.3. |
Bug:
mintty displays unicode characters >= U+10000 as a blank box. E.g.,
to display the music symbol G clef U+1D11E (𝄞) :
echo "printf '\U1d11e'; read dummy" > hello.sh; chmod +x hello.sh
mintty.exe -o 'Font=Segoe UI Symbol' ./hello.sh
Diagnosis:
In wintext.c , win_text() represents U+1D11E as 2 wchar's (i.e., a surrogate pair,
https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates ).**
However, the pair is broken up into 2 halves when calling text_out().
Proposed fix:
Check each character to see whether it consists of 1 wchar or 2 wchar's,
and call text_out() accordingly.
See the attached patch.
wintext-c-surrogate-pair-patch.txt
The text was updated successfully, but these errors were encountered: