onlyfonts-fonts7.01 KB
View saved version →
---
name: onlyfonts-fonts
description: Choose, pair and set free fonts for a project the way a good designer would, with sources, and give the code to use them, with the onlyfonts tools.
---
# Choosing, pairing and setting fonts with OnlyFonts
Use this when someone wants a font for something they make: a site, an app, a document, slides, a menu, a logo. Use it too when they ask what pairs with a font, how to set text, or for the code that loads fonts. Each rule ends with a source number such as (S10); references/sources.md names the source and its link.
## The tools
- search_fonts: free families from the OnlyFonts catalog for the person's words. category narrows to sans-serif, serif, monospace, display or handwriting; language keeps families that fully cover a language or script.
- get_font: one family's styles (weights and italics), designer, license, the languages it fully covers, its measures (x-height, width, stroke contrast, classification), computed pairings and look-alikes.
- get_font_css: one stylesheet link and the font-family lines for up to four families, with the weights and italics asked for, and the same ready for Next.js and Tailwind CSS.
- search_icons: icons from six open sets (Lucide, Heroicons, Material Symbols, Phosphor, Pierre, Tabler) as SVG in a color and style, with each set's license line and React code. Pick one set for a whole design, and one whose stroke weight sits well beside the type.
- Every catalog font is under an open license and free for any use, commercial too. The tools cannot install fonts on a computer, and they know nothing about paid fonts or the fonts a person already has.
## Steps
1. The brief. Ask or infer the job (body text, UI, headings, a logo, code) and the medium (web, app, print, slides). Then find every language the text holds (names people type included), three or four words for the mood, and the weights the design needs. Ask one short question only when the answer changes the pick; otherwise say what you assumed. (S10, S33)
2. Keep what exists. If the project already uses a font, keep it unless they asked for a change. (S54, S59)
3. Search. Call search_fonts with the person's own words, plus category and language when known. Run two or three searches with different words (the mood, the job, a font they like) so the options are more than the most popular families. (S58)
4. Check every candidate with get_font before you name it: the styles (a text face needs regular, italic, bold and bold italic), the languages it fully covers, the designer, its measures and its pairings. Drop any that fail the job. (S10, S13)
5. One family first. Try to do the whole job with one family's weights, widths, italics and sizes. Add a second family only for a job the first cannot do: code or data beside prose, a missing italic or weight, a missing script, a voice the brand needs. Three families at most. (S1, S10)
6. Offer two or three options. Each is a family or a pair with roles (heading, body, code), the weights it needs, and one line on why it fits, naming the rule. (S43, S55)
7. Deliver. Call get_font_css with the chosen ids and only the weights used (italic only if the text uses it). Give the link tag and the font-family lines exactly as returned, each family's page link, and the loading advice from references/web.md. Add the setting basics for the job from references/set.md.
## By job
| job | look for | set it | sources |
|---|---|---|---|
| body text on the web | a quiet text face with regular, italic, bold, bold italic; moderate contrast, open shapes | 16 px or more, line height about 1.4 to 1.6, 45 to 75 characters a line | S1, S2, S10, S13 |
| long reading (articles, books, docs) | a face that does not call attention to itself; true italics; oldstyle figures if it has them | 17 to 20 px on screen, 60 to 70 characters, flush left | S1, S2, S4, S26 |
| UI and dashboards | the system stack, or a neutral sans with five or more weights, clear I l 1, tabular figures | 14 to 16 px, two
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 7 — file references are metadata, not package contents.