Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2025-09-11 16:06:08 -05:00
parent 3464cbeb17
commit 318701bb3d
3 changed files with 12 additions and 6 deletions

View File

@ -35,6 +35,15 @@ enum FontFamily: String, CaseIterable {
} }
} }
var percentageDownsize: CGFloat {
switch self {
case .system:
return 0.99
case .georgia:
return 0.90
default: return 1
}
}
var fontWeights: [Font.Weight] { var fontWeights: [Font.Weight] {
guard let weightDict = Self.fontMapWeights[self.rawValue] else { guard let weightDict = Self.fontMapWeights[self.rawValue] else {
return [] return []

View File

@ -39,7 +39,7 @@ struct FontUtils {
} }
} }
return low return low * fontName.percentageDownsize
} }
static func createFont( static func createFont(

View File

@ -127,10 +127,7 @@ struct DigitView: View {
for: size) for: size)
// Only update if the size is significantly different to prevent micro-adjustments // Only update if the size is significantly different to prevent micro-adjustments
if abs(optimalSize - fontSize) > 0.1 { fontSize = optimalSize
fontSize = optimalSize
}
lastCalculatedSize = size lastCalculatedSize = size
// Reset calculation flag after a brief delay to allow for frame completion // Reset calculation flag after a brief delay to allow for frame completion