-
Notifications
You must be signed in to change notification settings - Fork 5
Fonts
swift-book-pdf requires a set of fonts to typeset The Swift Programming Language book. Learn how to make your fonts available to the typesetter.
Learn which fonts swift-book-pdf needs to run based on your installed version:
- v1.3 or later — recommended
- v1.2
- v1.1 or earlier
Starting with v1.3 and later, swift-book-pdf offers more flexibility with many default font options. Make sure that at least one font from each of the following categories is available to LuaTeX, or specify a custom font. swift-book-pdf will check if fonts are available for typesetting in the following order:
- Main Font: Helvetica Neue, Helvetica, SF Pro, Arial, Segoe UI, Liberation Sans, DejaVu Sans
- Unicode Font 1 : Arial Unicode MS
Note
If you don’t have access to Arial Unicode MS, you can download and specify the following Noto Sans font families:swift-book-pdf --unicode "Noto Sans" --unicode "Noto Sans SC" --unicode "Noto Sans KR" --unicode "Noto Sans Thai"
- Mono Font: Menlo, SF Mono, Monaco, Consolas, DejaVu Sans Mono, Ubuntu Mono, Courier New
- Emoji Font: Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji
- Header & Footer Font: SF Compact Display, SF Pro Display, SF Compact, SF Pro, Helvetica Neue, Helvetica, SF Pro, Arial, Segoe UI, Liberation Sans, DejaVu Sans
Make sure that at least one font from each of the following categories is available to LuaTeX, or specify a custom font. swift-book-pdf will check if fonts are available for typesetting in the following order:
- Main Font: Helvetica Neue, Helvetica, SF Pro, Arial, Segoe UI, Liberation Sans, DejaVu Sans
-
Unicode Font 1 : Arial Unicode MS,
Noto Sans CJK*,Noto Serif CJK*
*Deprecation Note
Fonts Noto Sans CJK and Noto Serif CJK do not support the entire range of Unicode characters required for typesetting, and have been removed from the default fonts list in v1.3 and later. You might encounter typesetting errors if you do not specify another Unicode font with wider glyph support.
Upgrade to v1.3 or later to specify multiple Unicode fonts.
- Mono Font: Menlo, SF Mono, Courier, Monaco, Consolas, Courier New, DejaVu Sans Mono, Ubuntu Mono
- Emoji Font: Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji
- Header & Footer Font: SF Compact Display, SF Pro Display, SF Compact, SF Pro, Helvetica Neue, Helvetica, SF Pro, Arial, Segoe UI, Liberation Sans, DejaVu Sans
swift-book-pdf requires that the following fonts be accessible by LuaTeX:
- Apple Color Emoji
- Arial Unicode MS
- Helvetica Neue
- Helvetica Neue Bold
- Menlo
- SF Compact Display
Starting with v1.2 and later, you can choose custom fonts for use in typesetting, instead of the default options. If you don’t have access to any of the predefined fonts in a font category, or want to specify your own fonts, use the following CLI options to provide swift-book-pdf with the font name to use for a font category:
--main--unicode
Note:
In v1.3 and later, you can specify multiple Unicode fonts.
If you don’t have access to Arial Unicode MS, you can download and specify the following Noto Sans font families:swift-book-pdf --unicode "Noto Sans" --unicode "Noto Sans SC" --unicode "Noto Sans KR" --unicode "Noto Sans Thai"
--mono--emoji--header-footer
1. Adds support for non-letter glyphs like Superscript Minus (⁻) and additional non-latin glyphs like 你, ᄒ, 三, which are not supported by the Main Font.