IMKCandidates // Extend candidateFont().

This commit is contained in:
ShikiSuen 2022-08-22 08:14:38 +08:00
parent ccb5468dc7
commit 1e306e9916
1 changed files with 17 additions and 0 deletions

View File

@ -57,7 +57,24 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
var attributes = attributes() var attributes = attributes()
// FB11300759: Set "NSAttributedString.Key.font" doesn't work. // FB11300759: Set "NSAttributedString.Key.font" doesn't work.
attributes?[NSAttributedString.Key.font] = candidateFont attributes?[NSAttributedString.Key.font] = candidateFont
if mgrPrefs.handleDefaultCandidateFontsByLangIdentifier {
switch IME.currentInputMode {
case InputMode.imeModeCHS:
if #available(macOS 12.0, *) {
attributes?[NSAttributedString.Key.languageIdentifier] = "zh-Hans" as AnyObject
}
case InputMode.imeModeCHT:
if #available(macOS 12.0, *) {
attributes?[NSAttributedString.Key.languageIdentifier] =
(mgrPrefs.shiftJISShinjitaiOutputEnabled || mgrPrefs.chineseConversionEnabled)
? "ja" as AnyObject : "zh-Hant" as AnyObject
}
default:
break
}
}
setAttributes(attributes) setAttributes(attributes)
update()
} }
} }