Voltaire // Differentiate Chinese fallback fonts per inputMode.
- Thanks to Dr. Ken Lunde's suggestion. Note that this only works with macOS 12 Monterey and later macOS releases.
This commit is contained in:
parent
f12ac42856
commit
9f37e3cdb8
|
@ -132,6 +132,14 @@ fileprivate class HorizontalCandidateView: NSView {
|
||||||
} else {
|
} else {
|
||||||
NSColor.controlBackgroundColor.setFill()
|
NSColor.controlBackgroundColor.setFill()
|
||||||
}
|
}
|
||||||
|
switch ctlInputMethod.currentKeyHandler.inputMode {
|
||||||
|
case InputMode.imeModeCHS:
|
||||||
|
if #available(macOS 12.0, *) {activeCandidateAttr[.languageIdentifier] = "zh-Hans" as AnyObject}
|
||||||
|
case InputMode.imeModeCHT:
|
||||||
|
if #available(macOS 12.0, *) {activeCandidateAttr[.languageIdentifier] = "zh-Hant" as AnyObject}
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
NSBezierPath.fill(rctCandidateArea)
|
NSBezierPath.fill(rctCandidateArea)
|
||||||
(keyLabels[index] as NSString).draw(in: rctLabel, withAttributes: activeCandidateIndexAttr)
|
(keyLabels[index] as NSString).draw(in: rctLabel, withAttributes: activeCandidateIndexAttr)
|
||||||
(displayedCandidates[index] as NSString).draw(in: rctCandidatePhrase, withAttributes: activeCandidateAttr)
|
(displayedCandidates[index] as NSString).draw(in: rctCandidatePhrase, withAttributes: activeCandidateAttr)
|
||||||
|
|
|
@ -138,6 +138,14 @@ fileprivate class VerticalCandidateView: NSView {
|
||||||
} else {
|
} else {
|
||||||
NSColor.controlBackgroundColor.setFill()
|
NSColor.controlBackgroundColor.setFill()
|
||||||
}
|
}
|
||||||
|
switch ctlInputMethod.currentKeyHandler.inputMode {
|
||||||
|
case InputMode.imeModeCHS:
|
||||||
|
if #available(macOS 12.0, *) {activeCandidateAttr[.languageIdentifier] = "zh-Hans" as AnyObject}
|
||||||
|
case InputMode.imeModeCHT:
|
||||||
|
if #available(macOS 12.0, *) {activeCandidateAttr[.languageIdentifier] = "zh-Hant" as AnyObject}
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
NSBezierPath.fill(rctCandidateArea)
|
NSBezierPath.fill(rctCandidateArea)
|
||||||
(keyLabels[index] as NSString).draw(in: rctLabel, withAttributes: activeCandidateIndexAttr)
|
(keyLabels[index] as NSString).draw(in: rctLabel, withAttributes: activeCandidateIndexAttr)
|
||||||
(displayedCandidates[index] as NSString).draw(in: rctCandidatePhrase, withAttributes: activeCandidateAttr)
|
(displayedCandidates[index] as NSString).draw(in: rctCandidatePhrase, withAttributes: activeCandidateAttr)
|
||||||
|
|
Loading…
Reference in New Issue