improvements on the ui
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user