// A studio's PLACE in its own look (Codex round 2: syz-studio; the// coordinator's review of aa7f6389e), on the flavour's own card// (`CardMaterial`): the studio, or a class of its catalogue, on its// photograph (`sharmila.studio`) — its name spaced over the photograph, the headline heavy// (`subtitle`, the tagline), whoever the card names on a mount with the// core's label for them (`people`: the founder, her photograph, through the// picture hook, `FaceMount`), a hairline, and its place by a pin (`place`:// the address) beside its days by a calendar (`period`); its pages after it,// as every face turns them (`FaceTurns`, the pages on its card).// No action is drawn on the card. Every word is the core's.importCottonPaperimportCottonValuesimportSwiftUI/// The studio, or a class of its catalogue: its name spaced over its/// photograph, the headline, the person it names, its place and days.publicstructStudioPlaceFace<Photo: View>: View {let card: DeckCardvar photo: Photo?/// The pages its card turns to after it (`card.pages`), each a column's/// words under its label (`FaceTurns`).var pages: [CardPage] = [] @Environment(\.theme) privatevar themepublicinit(card: DeckCard, photo: Photo?, pages: [CardPage] = []) {self.card = cardself.photo = photoself.pages = pages }publicvar body: someView {FaceTurns(pages: pages) { front } .onCardPaper(StudioPlaceFaceCatalogue.stock.laid(card.pace)) }/// The face itself, before the pages its card turns to. @ViewBuilder privatevar front: someView {GeometryReader { sheet in VStack(alignment: .leading, spacing: 12) {iflet name = card.text("title") {Text(name) .font(theme.type.title(StudioBrandKnobs.wordmarkSize)) .tracking(StudioBrandKnobs.wordmarkTracking) .textCase(.uppercase) .lineLimit(1) .foregroundStyle(theme.colors.ink.color) .accessibilityIdentifier("deck-title") .facePart(.title) }iflet photo { photo .frame(maxWidth: .infinity) .frame(height: sheet.size.height * StudioBrandKnobs.placeShare) .clipShape(RoundedRectangle(cornerRadius: StudioBrandKnobs.placeRadius, style: .continuous)) .accessibilityIdentifier("face-photo") .facePart(.picture) }StudioPlaceWords(card: card)Spacer(minLength: 0) } .padding(StudioBrandKnobs.inset) .frame(width: sheet.size.width, height: sheet.size.height, alignment: .topLeading) } }}privatestructStudioPlaceWords: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView { VStack(alignment: .leading, spacing: 12) {iflet headline = card.text("subtitle") {Text(headline) .font(theme.type.display(StudioBrandKnobs.headlineSize)) .lineLimit(3) .minimumScaleFactor(0.7) .faceInk(.ink) .facePart(.subtitle) }StudioPerson(card: card) .facePart(.people)Rectangle() .fill(theme.colors.hairline.color.opacity(StudioBrandKnobs.hairlineFaint)) .frame(height: 1) HStack(alignment: .top, spacing: 12) {iflet place = card.text("place") {StudioFact(symbol: "mappin", said: place, tint: theme.colors.accent.color, size: StudioBrandKnobs.factSize - 1) .facePart(.place) }iflet days = card.text("period") {StudioFact(symbol: "calendar", said: days, tint: theme.colors.accent.color, size: StudioBrandKnobs.factSize - 1) } }if card.text("place") == nil, card.text("period") == nil, let about = card.text("body") {Text(about) .font(theme.type.body(StudioBrandKnobs.aboutSize)) .lineLimit(3) .foregroundStyle(theme.colors.inkBody.color.opacity(StudioFaceKnobs.labelFaint)) .facePart(.body) } } }}/// The person a card names (the studio's founder) on a mount — their/// picture or their initials — under the core's label for them on this face.privatestructStudioPerson: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView {iflet entry = card.entries("people").first, let name = entry["name"]?.text { HStack(spacing: 14) {FaceMount(name: name, picture: entry["picture"]?.text, size: StudioBrandKnobs.founderMount) VStack(alignment: .leading, spacing: 2) {// The face's own label for this place only — the generic// one ("People") says nothing here.iflet label = entry["label"]?.text ?? StudioReading.ownLabel(card.face, "people") {Text(label) .font(theme.type.body(StudioBrandKnobs.labelSize)) .foregroundStyle(theme.colors.inkBody.color.opacity(StudioFaceKnobs.labelFaint)) }Text(name) .font(theme.type.title(StudioBrandKnobs.lineSize + 1)) .lineLimit(1) .minimumScaleFactor(0.7) .faceInk(.ink) } } .accessibilityElement(children: .combine) .accessibilityIdentifier("face-person") } }}extensionStudioReading {/// The core's label for a place on this face alone (`label.face.<face>.<slot>`),/// never the generic one every face shares.publicstaticfunc ownLabel(_ face: String, _ slot: String) -> String? {let path = "label.face.\(face).\(slot)"let said = ShellLines.line("cards", path)return said == "cards.\(path)" ? nil : said }}/// The studio's place face, and the cards it is reviewed in. A studio's kit/// names it for its place and its catalogue's classes (`sharmila.studio`),/// with the pages its card turns to; one with no photograph is a note, as/// every note is drawn (`NoteCard`: its words cut into pages for the room).publicenumStudioPlaceFaceCatalogue {publicstaticlet stock: FaceStock = .ornamentedpublicstaticlet ground: FaceGround = .paperpublicstaticlet face = Face(id: "sharmila.studio", specimens: [Specimen("studio", studio, picture: "verandah-wide")]) { card, picture, _ inif card.text("photo") == nil {NoteCard(card: card) } else {StudioPlaceFace(card: card, photo: picture, pages: card.pages) } }publicstaticlet studio = DeckCard(face: .sharmilaStudio, fields: ["photo": .text("verandah-wide"), "title": .text("Invented Studio"), "subtitle": .text("An invented tagline."),"people": .list([.object(["name": .text("Invented Founder"), "picture": .text("portrait")])]), "place": .text("Invented Road"),"period": .text("Mon\u{2013}Fri"), "body": .text("Invented words about the studio."), ])}