improvements on the ui

This commit is contained in:
2026-11-25 07:14:49 +01:00
parent 3afdb6d67f
commit b7c72b9e16
249 changed files with 19702 additions and 17358 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
import AppKit
/// IBM Plex Mono for the page, code, tables and bookmarks, IBM Plex Sans for the banner; the system fonts when Plex is missing.
/// IBM Plex Mono for the page, code, tables, bookmark lines and the bookmark index, IBM Plex Sans for the banner; the system fonts when Plex is missing.
public enum PlakFonts {
public static func body(_ size: CGFloat) -> NSFont {
FontRegistry.registerBundledFonts()
@@ -12,6 +12,12 @@ public enum PlakFonts {
return NSFont(name: "IBMPlexMono-Regular", size: size) ?? NSFont.monospacedSystemFont(ofSize: size, weight: .regular)
}
/// IBM Plex Mono Bold (700), the boldest bundled mono weight.
public static func monoBold(_ size: CGFloat) -> NSFont {
FontRegistry.registerBundledFonts()
return NSFont(name: "IBMPlexMono-Bold", size: size) ?? NSFont.monospacedSystemFont(ofSize: size, weight: .bold)
}
/// The height of one line of this font with no paragraph style.
static func naturalLineHeight(_ font: NSFont) -> CGFloat {
ceil(font.ascender - font.descender + font.leading)