-
Notifications
You must be signed in to change notification settings - Fork 38.7k
qt: fix broken unicode chars on osx 10.10 #5671
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
Conversation
|
Unfortunately this doesn't fix #5165. I spent most of the day chasing my tail on this and got nowhere. Unless someone else is interested in looking into this, we have 2 options for 0.10: busted Chinese for Yosemite, or building against the 10.8 sdk. |
|
Will test this. Can I just gbuid master? Busted Chinese on Yosemite 10.10 sounds more sane than switching to 10.8 in rc4 IMO. |
|
Uploading a binary, 2min. |
|
Tested. Fixes #5657 but leaves #5165 open. The problem of #5165 is, that the 'Lucia Grande' font does not support Chinese characters. We now substituting the system font by a non-Chinese-capable font. I think a quick fix could be to check within the 10.10 'if structur' if the users language is zh_CN (maybe there are others?) then substitute the font to "Henti TC" (OS X standard font for Chinese). A one or two-liner with low risks (only Chinese 10.10 users will see the change). |
|
@jonasschnelli I wasn't sure if we could do that, but since we require a restart to change fonts, that sounds good to me. It seems that all cjk fonts are broken in 10.10 due to the new aliasing system. Hard-coding for those 3 indeed sounds like a reasonable hack for 0.10. |
|
If #5165 only affects Chinese, then this + a Chinese-specific workaround for 0.10 is great. And indeed, for master we shouldnt bother with this and switch the build SDK. |
|
The current substitute font 'Lucida Grand' on osx 10.10 has only support for Greek, Hebrew, Cyrillic, Latin. So in general we should consider not giving substitutes for fonts because i assume the OS will care about switching fonts within a textflow or support extra fonts with mixed charsets. Currently the 'Lucida Grand' font has no support for: ACK on this change to fix #5165 but longterm we should update to 10.8 as build os and remove font substitution. |
SubstituteFonts() has been moved to after app identification so that QSettings are accessible.
|
Well that took quite a bit of trial+error, but all good now. Fixes #5165. It's not optimal... Chinese font-names don't show in English (when you're in English and going to select Chinese/Japanese from the menu, those characters are blocks). After switching it works fine though. The last commit avoids the hard-coded use of Arial, which does not always work correctly with Chinese. Seems sane to me, but I'm not sure if there was a specific reason for its use. The substitutions are all wrapped up in ifdefs, so they're safe for master now and in the future. The only functional change for master (after we bump the sdk to 10.8) is the Arial change. Test binary here: https://bitcoincore.org/cfields/bitcoin-qt-10.6_quickfix3-437de97c |
|
If it wasn't clear, the Arial change wasn't arbitrary... the splash is all boxes in Chinese otherwise. |
src/qt/guiutil.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Still issues (see screens below). I only see one direction: |
The default font changed again. The real fix is to compile qt against a >= 10.8 sdk, but this is simple enough to backport to 0.10 to avoid having to do that there. Note: NSAppKitVersionNumber is a double and there's no official value for NSAppKitVersionNumber10_10. Since == isn't reliable for doubles, use Apple's guidelines for testing versions here: https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ Chinese and Japanese fonts have been hard-coded as well, otherwise they fail to show up at all.
They may not contain all necessary characters for a language
|
After some discussion on IRC, I believe @jonasschnelli and I have reached a compromise here. German is fixed up now, and Chinese and Japanese work with the exception of a few artifacts. We're willing to accept that for 0.10, with the understanding that they'll be fixed in the future by the bumped sdk. |
- qt: avoid hard-coding font names They may not contain all necessary characters for a language - qt: fix broken unicode chars on osx 10.10 The default font changed again. The real fix is to compile qt against a >= 10.8 sdk, but this is simple enough to backport to 0.10 to avoid having to do that there. Note: NSAppKitVersionNumber is a double and there's no official value for NSAppKitVersionNumber10_10. Since == isn't reliable for doubles, use Apple's guidelines for testing versions here: https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ Chinese and Japanese fonts have been hard-coded as well, otherwise they fail to show up at all. - qt: fonts: allow SubstituteFonts to filter based on user's language SubstituteFonts() has been moved to after app identification so that QSettings are accessible. Github-Pull: #5671 Rebased-From: 73cd4ed 52954e6 f5ad78b
|
Cherry-picked to 0.10 branch as 58259ad |
- qt: avoid hard-coding font names They may not contain all necessary characters for a language - qt: fix broken unicode chars on osx 10.10 The default font changed again. The real fix is to compile qt against a >= 10.8 sdk, but this is simple enough to backport to 0.10 to avoid having to do that there. Note: NSAppKitVersionNumber is a double and there's no official value for NSAppKitVersionNumber10_10. Since == isn't reliable for doubles, use Apple's guidelines for testing versions here: https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ Chinese and Japanese fonts have been hard-coded as well, otherwise they fail to show up at all. - qt: fonts: allow SubstituteFonts to filter based on user's language SubstituteFonts() has been moved to after app identification so that QSettings are accessible. Github-Pull: bitcoin#5671 Rebased-From: 73cd4ed 52954e6 f5ad78b
- qt: avoid hard-coding font names They may not contain all necessary characters for a language - qt: fix broken unicode chars on osx 10.10 The default font changed again. The real fix is to compile qt against a >= 10.8 sdk, but this is simple enough to backport to 0.10 to avoid having to do that there. Note: NSAppKitVersionNumber is a double and there's no official value for NSAppKitVersionNumber10_10. Since == isn't reliable for doubles, use Apple's guidelines for testing versions here: https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ Chinese and Japanese fonts have been hard-coded as well, otherwise they fail to show up at all. - qt: fonts: allow SubstituteFonts to filter based on user's language SubstituteFonts() has been moved to after app identification so that QSettings are accessible. Github-Pull: bitcoin#5671 Rebased-From: 73cd4ed 52954e6 f5ad78b (cherry picked from commit 58259ad)














Fixes #5657 and likely #5165.
The default font changed again.
The real fix is to compile qt against a >= 10.8 sdk, but this is simple enough
to backport to 0.10 to avoid having to do that there.
Note: NSAppKitVersionNumber is a double and there's no official value for
NSAppKitVersionNumber10_10. Since == isn't reliable for doubles, use Apple's
guidelines for testing versions here:
https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/