Skip to content

Instantly share code, notes, and snippets.

@mbutterick
Created January 24, 2020 20:59
Show Gist options
  • Save mbutterick/77b66bf8dd605592c5b1da83294827c3 to your computer and use it in GitHub Desktop.
Save mbutterick/77b66bf8dd605592c5b1da83294827c3 to your computer and use it in GitHub Desktop.
Pollen + Quad example
#lang pollen
◊subhead{MB Type}
◊subhead{Frequently Asked Questions}
◊subsubhead{The #1 most frequently asked question}
◊qa{I'm a Windows user. I installed the standard OpenType fonts, but they don’t appear correctly in PDFs made with the PDF generator built into WordPerfect or Word on Windows.
This is a ◊link["http://typo.la/wordpdf"]{known limitation} of WordPerfect and Word on Windows. Switching to the OpenType TT fonts will cure the problem. So will switching to other PDF-making software, such as the Adobe PDF printer driver, which is included with Adobe Acrobat. (This advice does not apply to Mac OS.)}
◊subsubhead{Installation}
◊qa{Should I use OpenType (.otf) or OpenType TT (.ttf)?
Both formats work with Windows and Mac OS. If you primarily use Microsoft Office on Windows or WordPerfect, then you should use the OpenType TT fonts, because those programs are finicky. Otherwise, use the OpenType fonts.}
◊qa{Can I have both formats installed simultaneously?
No. Pick one.}
◊qa{How do I install or remove the fonts in Windows?
Right-click the fonts and select ◊em{Install}. Or, from the Start menu, open ◊em{Control Panel → Appearance and Personalization → Fonts} and drag the fonts into this folder. To remove fonts, quit any running programs, and then delete the fonts from this folder. I’ve found that it’s wise to restart after installing fonts, and before deleting. More detailed ◊link["http://typo.la/wininstall"]{installation} and ◊link["http://typo.la/winremove"]{removal} instructions are found under those links.}
◊qa{How do I install or remove the fonts on Mac OS?
From the main directory of your system drive, open the folder ◊em{Library}, then the folder ◊em{Fonts}. Drag the fonts into this folder. (To remove fonts, delete them from this folder.) You can also use ◊em{Applications -> Font Book} to install and remove fonts. More detailed ◊link["http://typo.la/macinstall"]{installation and removal instructions}.}
◊qa{Do I have to install them all?
No. You can just install the ones you need. If you're not sure which you need, install them all, and later you can delete the ones you don’t use.}
◊qa{How do I use the fonts in my documents?
Once installed, each family will show up in your Font menu under multiple subfamily names. (The exact number depends on the number of styles in the family.)}
◊qa{Do you issue updates for the fonts?
Yes, if I find a worthy bug, which is rare. (If you find one, ◊link["mailto:mb@mbtype.com"]{tell me}.) Beyond that, I avoid the "update everything constantly" credo of modern software development, and prefer the more old-fashioned "get it right before you ship it".}
◊qa{How should I install updated versions of the fonts?
Following the instructions above, remove the old versions, and then install the new ones. On Windows, it’s wise to restart before removing the old versions, and restart again after installing the new ones.}
◊subsubhead{Microsoft Word and its discontents}
◊qa{The font-embedding feature of Word isn’t working.
This feature is only supported in Windows versions of Microsoft Word, and requires that you use the OpenType TT fonts. Even then, it’s still pretty rickety. Avoid.}
◊qa{How do I activate OpenType features in Word?
◊link["https://practicaltypography.com/opentype-features.html"]{Follow these instructions.}}
◊qa{How do I activate multiple OpenType stylistic sets in Word?
It should be possible. But it never has been. And probably never will.}
◊subsubhead{License}
◊qa{Can I use the fonts in an e-book or app?
If your e-book or app format supports read-only embedding of fonts, yes—you don’t need an additional license.}
◊qa{Can I use the fonts on my website, as webfonts?
Sure, subject to the limitations ◊link["http://mbtype.com/license"]{in the license}.}
◊qa{Where are the webfonts?
They’re in the WOFF subfolder of the zip file you downloaded and extracted.}
◊qa{Can I upgrade my license to cover more people?
Yes, by paying the difference in price between licenses. Email me at ◊link["http://mbtype.com/license"]{mb@mbtype.com} and I'll send you an upgrade link.}
◊qa{Can I use the fonts in an open-source project?
No, because ◊link["http://mbtype.com/license"]{my font license} is not compatible with any open-source license. Investigate ◊link["https://practicaltypography.com/free-fonts.html"]{free fonts} instead.}
◊qa{Why can’t I store the fonts in a source repository?
Because on sites like GitHub, people assume everything is free for the taking. It's a major vector of unlicensed font usage. For non-open-source website repositories, I don’t mind if you base64-encode the fonts within a CSS file.}
◊qa{I want to buy a two-person license but my employer needs you to fill out this vendor paperwork with your social-security number and home address and ...
Sorry, but no. The costs of these chores would far exceed the price of the font license.}
◊qa{My tech startup needs a font, but we have some special requirements.
Tech startups who start with this question always reach the logical conclusion that they're better off with ◊link["https://practicaltypography.com/free-fonts.html"]{free fonts}. Because unlike my fonts, they have almost no license restrictions, and they cost nothing.}
◊subsubhead{Fonts in use}
◊qa{I used your fonts in my project. Do you want to see it?
Sure, I always enjoy seeing my fonts in use. If you made a book or other printed item, you're welcome to send a copy to 1920 Hillhurst Ave. #406, LA CA 90027.}
◊qa{Will you critique my design?
No. As a teacher of typography, my prime directive is not to interrupt the natural progress of others. I decline critiques because your struggle is healthy and normal. Embrace it.}
◊subsubhead{Languages}
◊qa{What languages do the fonts support?
Afrikaans, Albanian, Basque, Catalan, the Celtic languages, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Hungarian, Icelandic, Indonesian, Irish, Italian, Latvian, Lithuanian, Malay, Maltese, Norwegian, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tagalog, and Turkish.}
#lang debug racket/base
(require racket/match
racket/list
gregor
pollen/decode
quadwriter/tags)
(provide (all-defined-out) (all-from-out quadwriter/tags))
(define (linebreaker xs) (decode-linebreaks xs '(q ((break "line")))))
(define (root . xs)
(list* 'q
`((column-count "2")
(page-margin-left "40")
(page-margin-top "40")
(font-size "9.5")
(footer-display "true")
(footer-text ,(string-append "v." (~t (now) "YYMMdd")))
(line-height "13"))
(decode-paragraphs xs (λ (pxs) `(q (q ((break "para"))) (q ,@pxs)))
#:linebreak-proc linebreaker)))
(define (qa . xs)
(match-define (cons question answers) (decode-paragraphs xs '@ #:linebreak-proc linebreaker))
`(q
(q ((font-bold "true")(font-size "9.25")(font-tracking "0.12")(font-family "question")(space-after "3")(keep-with-next "true")(keep-all-lines "true")) ,question)
(q ((break "para")))
(q ((space-after "12")(keep-all-lines "true")(hyphenate "true")) ,@(add-between answers '(q ((break "para")))))))
(define (link url . xs)
(apply a #:href url xs))
(define (subhead . xs)
`(q ((font-family "heading")
(font-features "caps 1")
(font-size "14")
(line-height "18")
(keep-with-next "true")
(space-before "8")
(space-after "8")
(border-width-top "0.5")
(border-inset-top "1")
(border-color-top "black")
(display "block")) ,@(map string-upcase xs)))
(define (subsubhead . xs)
`(q ((font-family "level-3")
(font-features "c2sc 1")
(keep-with-next "true")
(space-before "4")
(space-after "4")
(border-width-top "0.5")
(border-inset-top "3")
(border-color-top "black")
(display "block")) ,@xs))
◊(local-require quadwriter)
◊(render-pdf doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment