diff --git a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CandidateCellDataExtension.swift b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CandidateCellDataExtension.swift index 08417282..98364cf1 100644 --- a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CandidateCellDataExtension.swift +++ b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/CandidateCellDataExtension.swift @@ -20,7 +20,7 @@ extension CandidateCellData { VStack(spacing: 0) { HStack(spacing: 4) { if UserDefaults.standard.bool(forKey: UserDef.kHandleDefaultCandidateFontsByLangIdentifier.rawValue) { - Text(AttributedString(attributedStringHeader)).frame(width: CandidateCellData.unifiedSize * 2 / 3) + Text(AttributedString(attributedStringHeader)) Text(AttributedString(attributedString)) } else { Text(key).font(.system(size: fontSizeKey).monospaced()) diff --git a/Packages/vChewing_Shared/Sources/Shared/CandidateBasicUnits.swift b/Packages/vChewing_Shared/Sources/Shared/CandidateBasicUnits.swift index 7428d86a..b4116cc4 100644 --- a/Packages/vChewing_Shared/Sources/Shared/CandidateBasicUnits.swift +++ b/Packages/vChewing_Shared/Sources/Shared/CandidateBasicUnits.swift @@ -31,7 +31,7 @@ public class CandidateCellData: Hashable { public var subIndex: Int = 0 public var fontSizeCandidate: Double { CandidateCellData.unifiedSize } - public var fontSizeKey: Double { ceil(CandidateCellData.unifiedSize * 0.8) } + public var fontSizeKey: Double { max(ceil(CandidateCellData.unifiedSize * 0.6), 11) } public var fontColorKey: NSColor { isSelected ? .selectedMenuItemTextColor.withAlphaComponent(0.8) : .secondaryLabelColor } @@ -62,9 +62,9 @@ public class CandidateCellData: Hashable { paraStyle.alignment = .natural let theFontForCandidateKey: NSFont = { if #available(macOS 10.15, *) { - return NSFont.monospacedSystemFont(ofSize: size * 0.7, weight: .regular) + return NSFont.monospacedSystemFont(ofSize: fontSizeKey, weight: .regular) } - return NSFont.monospacedDigitSystemFont(ofSize: size * 0.7, weight: .regular) + return NSFont.monospacedDigitSystemFont(ofSize: fontSizeKey, weight: .regular) }() var attrKey: [NSAttributedString.Key: AnyObject] = [ .font: theFontForCandidateKey,