@mkupper said in 门这个字显示有问题:
I am wondering though what the font picking logic is.
Black magic on the part of the OS. It’s influenced by the Direct Write setting, but it can still sometimes pick an alternate font for certain glyphs, even with DW off (as you showed).
Unfortunately, I don’t know the behind-the-scenes stuff.
I thought there was a discussion a few years ago, where I had some knowledge then than I do not now have [it was research done at the time, but the details are long since forgotten], but I cannot seem to find the post(s) I’m thinking about for the moment –
update 1: ah, there it is: I was thinking about the posts dealing with “CompositeFont” – so read the discussions from that search for more…
—
update 2: I searched the internet for “what characters look similar to U+95E8”, and though the first SO question I found didn’t answer what looked similar, it did show a screenshot from something else that shows that the glyph that Notepad++ displays is not unheard-of for U+95E8, even outside of Notepad++.
—
update 3: per this, it looks like the alternate glyph we’re seeing might be the Japanese Kanji / Ryakuji form. Ooh, and that page also looks like U+2ED4 might give the glyph you are looking for (though I cannot comment on meaning or implication of using one Unicode codepoint vs the other.)
The two compared in Notepad++:
55a57ad1-009d-4955-844f-97edab8f688f-image.png
—
update 4: MS Notepad has the same issue with that character:
a154b1f8-7336-44ec-ad4e-99c31b14774d-image.png
And looking through my C:\Windows\Fonts\GlobalMonospace.CompositeFont (see the “CompositeFont” search link, above), which lists some alternate fonts that support CJK Unified range:
939eb42e-f487-4100-9072-161cd5a259f6-image.png
If I change to “Microsoft YaHei” as the font for Notepad++ (or MS Notepad), I can get Notepad++ to show the glyph you expect for U+95E8:
20b89ced-d411-4b11-91ee-8a3745e1807b-image.png
… but it’s not a monospaced font, and every once in a while (on Notepad++ display refresh, maybe?), it seems to have to do some complicated re-drawing.
But if you can find a monospace font with the appropriate unicode slots populated that you’re willing to have as your Notepad++ font, that might work for you.
—
Caveat: I don’t deal with such characters or glyphs in my personal nor professional life; I just find myself drawn in when the unexpected happens in Notepad++, and I’m trying to be helpful, based on what I can find with some research on the internet that might shed light for me or those who bother reading my posts…