// The reader's faces and its knobs as the core answers them (`shell.reader`'s// `settings`, from the synced `face_settings` row keyed `reader`).//// A face is a whole (the coordinator, 4 Nov 2026): its ground, its ink, its// secondary ink and its hairline, from `BookFaceMaterial`. The page is the// whole screen in the face's ground; every word of the chrome is drawn in// its inks. Which face is worn, what each knob holds, and what a choice// writes are the core's (`phone::reader`); this file only names the// materials a face is drawn in and decodes the knobs Readium is handed.importCottonPaperimportSwiftUI/// One of the reader's three faces, as it is drawn.enumReaderFace: String, CaseIterable, Sendable, Decodable {case paper, sepia, nightvar ground: SwiftUI.Color { material.ground.colour }var ink: SwiftUI.Color { material.ink.colour }var secondary: SwiftUI.Color { material.secondary.colour }var hairline: SwiftUI.Color { ink.opacity(BookFaceMaterial.hairline(dark: dark)) }var dark: Bool { self == .night }var material: (ground: BookFaceMaterial, ink: BookFaceMaterial, secondary: BookFaceMaterial) {switchself {case .paper: (.paperGround, .paperInk, .paperSecondary)case .sepia: (.sepiaGround, .sepiaInk, .sepiaSecondary)case .night: (.nightGround, .nightInk, .nightSecondary) } }}/// A typeface the Typeface knob sets, as Readium is handed it (`ReaderLook.family`).enumReaderTypeface: String, CaseIterable, Sendable, Decodable {/// The book's own type.case publisher/// Libre Caslon, CottonPaper's book Caslon.case serif/// The system's face.case sans/// OpenDyslexic.case dyslexic}/// The reader's settings, as the core answers them.structReaderSettings: Equatable, Sendable, Decodable {/// The face chosen, and the face the page wears now (Night while the/// phone is dark and the person follows it).var face: ReaderFace = .papervar worn: ReaderFace = .papervar knobs = Knobs()structKnobs: Equatable, Sendable, Decodable {var size: Double = 1.0var lineHeight: Double?var margins: Double?var typeface: ReaderTypeface = .publishervar layout = "pages"var follow = falsevar weight = "regular"var justify = falsevar publisherStyles = truevar pdfFit = "width"var scroll: Bool { layout == "scroll" }var bold: Bool { weight == "bold" }var pdfWholePage: Bool { pdfFit == "page" }enumCodingKeys: String, CodingKey {case size, margins, typeface, layout, follow, weight, justifycase lineHeight = "line_height", publisherStyles = "publisher_styles", pdfFit = "pdf_fit" } }}