diff --git a/README.md b/README.md index 019dbc8..b97e5b3 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ links below to their main page. into everyday docs. - [**swank-tex**](https://typst.app/universe/package/swank-tex): Render those funky logos for TeX, LaTeX, and friends. +- [**tasteful-pairings**](https://typst.app/universe/package/tasteful-pairings): + A carefully curated collection of font pairings focusing on readability and + typographic harmony. ## Templates diff --git a/tasteful-pairings/.gitignore b/tasteful-pairings/.gitignore new file mode 100644 index 0000000..f1ca904 --- /dev/null +++ b/tasteful-pairings/.gitignore @@ -0,0 +1,2 @@ +tests/**/out/ +tests/**/diff/ diff --git a/tasteful-pairings/LICENSE b/tasteful-pairings/LICENSE new file mode 100644 index 0000000..a4ad6f1 --- /dev/null +++ b/tasteful-pairings/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Stephen Waits + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tasteful-pairings/README.md b/tasteful-pairings/README.md new file mode 100644 index 0000000..8d4dfba --- /dev/null +++ b/tasteful-pairings/README.md @@ -0,0 +1,57 @@ +# Tasteful Pairings + +A carefully curated collection of font pairings for [Typst](https://typst.app/), +focusing on readability and typographic harmony. Each pairing combines a +sans-serif heading font with a serif body font, following established +typographic principles for clear visual hierarchy and optimal reading +experience. + +## Installation + +```typ +#import "@preview/tasteful-pairings:0.1.0": * +``` + +## Usage + +```typ +#let pairing = font-pairings.at("modern-heritage") + +#show heading: set text(font: pairing.heading) +#set text(font: pairing.body) + += Your Document Title +Your content here... +``` + +## Available Pairings + +- **`ibm-plex`** - Modern corporate-friendly superfamily +- **`noto`** - Extensive language support, highly legible +- **`source`** - Adobe's refined open-source pair +- **`friendly-weather`** - Open Fira Sans with space-efficient Merriweather +- **`android`** - Complete Roboto family look +- **`kindle`** - Amazon's reading-optimized fonts +- **`office`** - Classic Microsoft Office combination +- **`modern-heritage`** - Contemporary Montserrat with timeless Georgia Pro +- **`legible`** - Reading-focused Lexend and Literata + +## Gallery + +![Font pairing examples gallery](thumbnail.png) + +## Philosophy + +The pairings in this collection follow these principles: + +1. **Sans for Headlines, Serif for Body** - Following traditional typographic + wisdom for clear hierarchy +2. **Readability First** - Each pairing is tested for optimal reading experience +3. **Complementary Characteristics** - Fonts are matched based on x-height, + weight balance, and character width +4. **Practical Applications** - Selected for real-world use cases from corporate + documents to digital reading + +## License + +[MIT License](LICENSE). diff --git a/tasteful-pairings/lib.typ b/tasteful-pairings/lib.typ new file mode 100644 index 0000000..dd41dd0 --- /dev/null +++ b/tasteful-pairings/lib.typ @@ -0,0 +1 @@ +#import "src/main.typ": font-pairings diff --git a/tasteful-pairings/src/main.typ b/tasteful-pairings/src/main.typ new file mode 100644 index 0000000..f0cd1e3 --- /dev/null +++ b/tasteful-pairings/src/main.typ @@ -0,0 +1,55 @@ +#let font-pairings = ( + "ibm-plex": ( + heading: "IBM Plex Sans", + body: "IBM Plex Serif", + description: "A modern corporate-friendly superfamily with a wide weight range. Clean, neutral, and highly legible." + ), + + "noto": ( + heading: "Noto Sans", + body: "Noto Serif", + description: "Huge language coverage, highly legible, and neutral. Great for multilingual documents." + ), + + "source": ( + heading: "Source Sans Pro", + body: "Source Serif Pro", + description: "Adobe's open-source pair. Clean, highly readable, and well-hinted for both screen and print." + ), + + "friendly-weather": ( + heading: "Fira Sans", + body: "Merriweather", + description: "Open, friendly sans plus a space-efficient modern serif. Good for text-heavy documents." + ), + + "android": ( + heading: "Roboto", + body: "Roboto Serif", + description: "A complete Android-friendly look. Roboto is extremely common; Roboto Serif is its matching new serif companion." + ), + + "kindle": ( + heading: "Amazon Ember", + body: "Bookerly", + description: "The Kindle pairing. Bookerly is a warm, book-like serif; Amazon Ember is a clean, readable sans." + ), + + "office": ( + heading: "Calibri", + body: "Cambria", + description: "A classic Microsoft Office pairing. Calibri (sans) for headings, Cambria (serif) for body text." + ), + + "modern-heritage": ( + heading: "Montserrat", + body: "Georgia Pro", + description: "Merges the warm, traditional forms of Georgia Pro with Montserrat’s clean, geometric lines. A modern-yet-classic pairing, equally suited to formal reports or stylish web layouts." + ), + + "legible": ( + heading: "Lexend", + body: "Literata", + description: "An ultra-legible pairing designed for reading fluency. Lexend’s tall x-height and open shapes reduce visual stress, while Literata brings a warm, bookish feel to body text." + ), +) diff --git a/tasteful-pairings/tests/gallery/ref/1.png b/tasteful-pairings/tests/gallery/ref/1.png new file mode 100644 index 0000000..1bc99ae Binary files /dev/null and b/tasteful-pairings/tests/gallery/ref/1.png differ diff --git a/tasteful-pairings/tests/gallery/test.typ b/tasteful-pairings/tests/gallery/test.typ new file mode 100644 index 0000000..ea8d9b7 --- /dev/null +++ b/tasteful-pairings/tests/gallery/test.typ @@ -0,0 +1,23 @@ +#import "/lib.typ": * + +#set page(margin: 1em, height: auto, width: 5.5in) +#set par(justify: true, linebreaks: "optimized") + +#let keys = font-pairings.keys().sorted() + +#for key in keys { + block( + stroke: 1pt + navy, + inset: 1em, + radius: 1em, + [ + #let pairing = font-pairings.at(key) + #show heading: set text(font: pairing.heading, weight: "bold") + = #pairing.heading & #pairing.body #h(1fr) #text(fill: eastern, weight: "light", size: 0.8em, baseline: -3pt, ["#key"]) + #set text(font: pairing.body, weight: "light") + #pairing.description + + #lorem(20) + ] + ) +} diff --git a/tasteful-pairings/thumbnail.png b/tasteful-pairings/thumbnail.png new file mode 100644 index 0000000..0f69a0c Binary files /dev/null and b/tasteful-pairings/thumbnail.png differ diff --git a/tasteful-pairings/typst.toml b/tasteful-pairings/typst.toml new file mode 100644 index 0000000..38a45ef --- /dev/null +++ b/tasteful-pairings/typst.toml @@ -0,0 +1,10 @@ +[package] +name = "tasteful-pairings" +version = "0.1.0" +entrypoint = "lib.typ" +authors = ["Stephen Waits "] +license = "MIT" +description = "A set of manually curated font-pairings which work well together." +keywords = ["font", "pairing", "typography"] +repository = "https://github.com/swaits/typst-collection" +exclude = ["thumbnail.png", "tests"]