fontisan 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +79 -4
- data/docs/.gitignore +17 -0
- data/docs/.vitepress/config.ts +317 -0
- data/docs/.vitepress/theme/components/ApiMethod.vue +127 -0
- data/docs/.vitepress/theme/components/Badge.vue +51 -0
- data/docs/.vitepress/theme/components/FeatureComparison.vue +87 -0
- data/docs/.vitepress/theme/components/HeroCodeBlock.vue +98 -0
- data/docs/.vitepress/theme/components/WithinHero.vue +30 -0
- data/docs/.vitepress/theme/index.ts +22 -0
- data/docs/.vitepress/theme/style.css +330 -0
- data/docs/api/conversion-options.md +141 -0
- data/docs/api/converters/curve-converter.md +34 -0
- data/docs/api/converters/hint-converter.md +34 -0
- data/docs/api/converters/outline-converter.md +27 -0
- data/docs/api/font-loader.md +111 -0
- data/docs/api/font-writer.md +103 -0
- data/docs/api/index.md +79 -0
- data/docs/api/models/glyph-accessor.md +43 -0
- data/docs/api/models/glyph.md +40 -0
- data/docs/api/models/table-analyzer.md +35 -0
- data/docs/api/sfnt-font.md +53 -0
- data/docs/api/type1-font.md +43 -0
- data/docs/api/validators/font-validator.md +31 -0
- data/docs/api/validators/helper.md +36 -0
- data/docs/api/validators/profile.md +39 -0
- data/docs/cli/convert.md +87 -0
- data/docs/cli/dump-table.md +110 -0
- data/docs/cli/export.md +176 -0
- data/docs/cli/features.md +124 -0
- data/docs/cli/glyphs.md +90 -0
- data/docs/cli/index.md +208 -0
- data/docs/cli/info.md +254 -0
- data/docs/cli/instance.md +122 -0
- data/docs/cli/ls.md +95 -0
- data/docs/cli/optical-size.md +94 -0
- data/docs/cli/pack.md +125 -0
- data/docs/cli/scripts.md +105 -0
- data/docs/cli/subset.md +39 -0
- data/docs/cli/tables.md +84 -0
- data/docs/cli/unicode.md +101 -0
- data/docs/cli/validate.md +48 -0
- data/docs/cli/variable.md +126 -0
- data/docs/cli/version.md +46 -0
- data/docs/guide/cli/convert.md +108 -0
- data/docs/guide/cli/export.md +138 -0
- data/docs/guide/cli/index.md +99 -0
- data/docs/guide/cli/info.md +144 -0
- data/docs/guide/cli/pack.md +155 -0
- data/docs/guide/cli/subset.md +118 -0
- data/docs/guide/cli/validate.md +139 -0
- data/docs/guide/color-fonts/bitmaps.md +177 -0
- data/docs/guide/color-fonts/colr-cpal.md +175 -0
- data/docs/guide/color-fonts/index.md +140 -0
- data/docs/guide/color-fonts/svg.md +154 -0
- data/docs/guide/color.md +51 -0
- data/docs/guide/comparisons/font-validator.md +222 -0
- data/docs/guide/comparisons/fonttools.md +200 -0
- data/docs/guide/comparisons/index.md +83 -0
- data/docs/guide/comparisons/lcdf-typetools.md +205 -0
- data/docs/guide/contributing.md +279 -0
- data/docs/guide/conversion/collections.md +251 -0
- data/docs/guide/conversion/curves.md +246 -0
- data/docs/guide/conversion/index.md +157 -0
- data/docs/guide/conversion/options.md +251 -0
- data/docs/guide/conversion/ttf-otf.md +184 -0
- data/docs/guide/conversion/type1.md +208 -0
- data/docs/guide/conversion/web.md +240 -0
- data/docs/guide/conversion.md +39 -0
- data/docs/guide/formats/collections.md +147 -0
- data/docs/guide/formats/dfont.md +99 -0
- data/docs/guide/formats/index.md +65 -0
- data/docs/guide/formats/otf.md +103 -0
- data/docs/guide/formats/svg.md +97 -0
- data/docs/guide/formats/ttf.md +105 -0
- data/docs/guide/formats/type1.md +118 -0
- data/docs/guide/formats/woff.md +115 -0
- data/docs/guide/hinting/autohint.md +141 -0
- data/docs/guide/hinting/conversion.md +161 -0
- data/docs/guide/hinting/index.md +86 -0
- data/docs/guide/hinting/postscript.md +149 -0
- data/docs/guide/hinting/truetype.md +135 -0
- data/docs/guide/hinting.md +44 -0
- data/docs/guide/index.md +152 -0
- data/docs/guide/installation.md +116 -0
- data/docs/guide/migrations/extract-ttc.md +549 -0
- data/docs/guide/migrations/font-validator.md +260 -0
- data/docs/guide/migrations/fonttools.md +208 -0
- data/docs/guide/migrations/index.md +64 -0
- data/docs/guide/migrations/otfinfo.md +197 -0
- data/docs/guide/quick-start.md +204 -0
- data/docs/guide/type1.md +58 -0
- data/docs/guide/universal-outline.md +151 -0
- data/docs/guide/validation/custom.md +195 -0
- data/docs/guide/validation/helpers.md +188 -0
- data/docs/guide/validation/index.md +132 -0
- data/docs/guide/validation/profiles.md +156 -0
- data/docs/guide/validation.md +47 -0
- data/docs/guide/variable-fonts/advanced.md +231 -0
- data/docs/guide/variable-fonts/axes.md +209 -0
- data/docs/guide/variable-fonts/conversion.md +197 -0
- data/docs/guide/variable-fonts/index.md +84 -0
- data/docs/guide/variable-fonts/instances.md +187 -0
- data/docs/guide/variable-fonts/named-instances.md +194 -0
- data/docs/guide/variable-fonts/static.md +168 -0
- data/docs/guide/variable.md +58 -0
- data/docs/guide/woff.md +59 -0
- data/docs/index.md +136 -0
- data/docs/lychee.toml +37 -0
- data/docs/package-lock.json +2560 -0
- data/docs/package.json +15 -0
- data/docs/public/apple-touch-icon.png +0 -0
- data/docs/public/favicon-96x96.png +0 -0
- data/docs/public/favicon.ico +0 -0
- data/docs/public/favicon.svg +1 -0
- data/docs/public/logo-full.svg +1 -0
- data/docs/public/logo.svg +1 -0
- data/docs/public/site.webmanifest +21 -0
- data/docs/public/web-app-manifest-192x192.png +0 -0
- data/docs/public/web-app-manifest-512x512.png +0 -0
- data/fontisan.gemspec +1 -1
- data/lib/fontisan/commands/features_command.rb +0 -1
- data/lib/fontisan/commands/scripts_command.rb +0 -1
- data/lib/fontisan/loading_modes.rb +0 -2
- data/lib/fontisan/sfnt_font.rb +4 -3
- data/lib/fontisan/tables/glyf/compound_glyph.rb +0 -1
- data/lib/fontisan/variable/delta_applicator.rb +3 -3
- data/lib/fontisan/variation/optimizer.rb +0 -1
- data/lib/fontisan/version.rb +1 -1
- data/lib/fontisan.rb +3 -2
- metadata +122 -4
data/docs/cli/index.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: CLI Reference
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# CLI Reference
|
|
6
|
+
|
|
7
|
+
Fontisan provides a comprehensive command-line interface for font processing tasks.
|
|
8
|
+
|
|
9
|
+
::: warning Font License Considerations
|
|
10
|
+
Commercial fonts often come with restrictive licenses that may prohibit:
|
|
11
|
+
|
|
12
|
+
- **Subsetting** — Reducing the character set
|
|
13
|
+
- **Format conversion** — Converting between TTF, OTF, WOFF, etc.
|
|
14
|
+
- **Variable font instancing** — Generating static instances
|
|
15
|
+
- **Glyph modification** — Altering or extracting individual glyphs
|
|
16
|
+
- **Redistribution** — Sharing converted or modified fonts
|
|
17
|
+
|
|
18
|
+
Always check your font's End User License Agreement (EULA) before processing. Many foundries require additional licenses for web embedding, subsetting, or format conversion. Fontisan provides the tools — you are responsible for ensuring you have the rights to use them.
|
|
19
|
+
:::
|
|
20
|
+
|
|
21
|
+
## Quick Reference
|
|
22
|
+
|
|
23
|
+
### Font Information Commands
|
|
24
|
+
|
|
25
|
+
| Command | Description | Example |
|
|
26
|
+
|---------|-------------|---------|
|
|
27
|
+
| `info` | Get comprehensive font information | `fontisan info font.ttf` |
|
|
28
|
+
| `ls` | List fonts in a collection | `fontisan ls fonts.ttc` |
|
|
29
|
+
| `tables` | Show font table information | `fontisan tables font.ttf` |
|
|
30
|
+
| `glyphs` | List glyphs with names and IDs | `fontisan glyphs font.ttf` |
|
|
31
|
+
| `unicode` | Show Unicode coverage | `fontisan unicode font.ttf` |
|
|
32
|
+
| `scripts` | List supported scripts | `fontisan scripts font.ttf` |
|
|
33
|
+
| `features` | List OpenType features | `fontisan features font.ttf` |
|
|
34
|
+
| `variable` | Show variable font axes | `fontisan variable font.ttf` |
|
|
35
|
+
| `optical-size` | Show optical size info | `fontisan optical-size font.ttf` |
|
|
36
|
+
|
|
37
|
+
### Font Operations
|
|
38
|
+
|
|
39
|
+
| Command | Description | Example |
|
|
40
|
+
|---------|-------------|---------|
|
|
41
|
+
| `convert` | Convert between formats | `fontisan convert input.ttf --to otf` |
|
|
42
|
+
| `subset` | Subset fonts | `fontisan subset font.ttf --chars "ABC"` |
|
|
43
|
+
| `validate` | Validate fonts | `fontisan validate font.ttf` |
|
|
44
|
+
| `instance` | Generate variable font instances | `fontisan instance var.ttf --wght 700` |
|
|
45
|
+
| `dump-table` | Extract raw table data | `fontisan dump-table font.ttf head` |
|
|
46
|
+
|
|
47
|
+
### Collection Operations
|
|
48
|
+
|
|
49
|
+
| Command | Description | Example |
|
|
50
|
+
|---------|-------------|---------|
|
|
51
|
+
| `pack` | Create font collections | `fontisan pack *.ttf -o fonts.ttc` |
|
|
52
|
+
| `unpack` | Extract from collections | `fontisan unpack fonts.ttc -d ./out` |
|
|
53
|
+
|
|
54
|
+
### Export Operations
|
|
55
|
+
|
|
56
|
+
| Command | Description | Example |
|
|
57
|
+
|---------|-------------|---------|
|
|
58
|
+
| `export` | Export to TTX, SVG, JSON | `fontisan export font.ttf --format ttx` |
|
|
59
|
+
|
|
60
|
+
## Global Options
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
fontisan [options] <command>
|
|
64
|
+
|
|
65
|
+
Options:
|
|
66
|
+
--format FORMAT Output format (text, yaml, json)
|
|
67
|
+
--verbose Verbose output
|
|
68
|
+
--quiet Suppress non-error output
|
|
69
|
+
--help Show help
|
|
70
|
+
--version Show version
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Getting Help
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# General help
|
|
77
|
+
fontisan --help
|
|
78
|
+
|
|
79
|
+
# Command-specific help
|
|
80
|
+
fontisan convert --help
|
|
81
|
+
fontisan validate --help
|
|
82
|
+
fontisan instance --help
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Output Formats
|
|
86
|
+
|
|
87
|
+
Most commands support multiple output formats:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Text (default)
|
|
91
|
+
fontisan info font.ttf
|
|
92
|
+
|
|
93
|
+
# YAML
|
|
94
|
+
fontisan info font.ttf --format yaml
|
|
95
|
+
|
|
96
|
+
# JSON
|
|
97
|
+
fontisan info font.ttf --format json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Common Workflows
|
|
101
|
+
|
|
102
|
+
### Inspect a Font
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Basic information
|
|
106
|
+
fontisan info font.ttf
|
|
107
|
+
|
|
108
|
+
# Detailed table listing
|
|
109
|
+
fontisan tables font.ttf
|
|
110
|
+
|
|
111
|
+
# See all glyphs
|
|
112
|
+
fontisan glyphs font.ttf
|
|
113
|
+
|
|
114
|
+
# Check Unicode coverage
|
|
115
|
+
fontisan unicode font.ttf
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Convert for Web
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Convert single font to WOFF2
|
|
122
|
+
fontisan convert font.ttf --to woff2 --output font.woff2
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Work with Variable Fonts
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Inspect variable font axes
|
|
129
|
+
fontisan variable VariableFont.ttf
|
|
130
|
+
|
|
131
|
+
# Generate a specific instance
|
|
132
|
+
fontisan instance VariableFont.ttf --wght 700 --output Bold.ttf
|
|
133
|
+
|
|
134
|
+
# Generate multiple instances
|
|
135
|
+
fontisan instance VariableFont.ttf --wght 400 --output Regular.ttf
|
|
136
|
+
fontisan instance VariableFont.ttf --wght 700 --output Bold.ttf
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Work with Collections
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# List fonts in collection
|
|
143
|
+
fontisan ls fonts.ttc
|
|
144
|
+
|
|
145
|
+
# Extract all fonts
|
|
146
|
+
fontisan unpack fonts.ttc --output-dir ./extracted
|
|
147
|
+
|
|
148
|
+
# Extract and convert to web formats
|
|
149
|
+
fontisan unpack fonts.ttc --output-dir ./web --format woff2
|
|
150
|
+
|
|
151
|
+
# Create a collection
|
|
152
|
+
fontisan pack Regular.ttf Bold.ttf --output Family.ttc
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Validate Fonts
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Quick validation
|
|
159
|
+
fontisan validate font.ttf
|
|
160
|
+
|
|
161
|
+
# Validate for Google Fonts
|
|
162
|
+
fontisan validate font.ttf --profile google_fonts
|
|
163
|
+
|
|
164
|
+
# Strict validation
|
|
165
|
+
fontisan validate font.ttf --profile production
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Export Font Data
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Export to TTX (XML format)
|
|
172
|
+
fontisan export font.ttf --format ttx --output font.ttx
|
|
173
|
+
|
|
174
|
+
# Export to JSON
|
|
175
|
+
fontisan export font.ttf --format json --output font.json
|
|
176
|
+
|
|
177
|
+
# Export specific tables
|
|
178
|
+
fontisan export font.ttf --format ttx --tables head,name,cmap
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Command Documentation
|
|
182
|
+
|
|
183
|
+
Detailed documentation for each command:
|
|
184
|
+
|
|
185
|
+
### Font Information
|
|
186
|
+
- [info](/cli/info) — Extract font metadata and properties (includes brief mode)
|
|
187
|
+
- [ls](/cli/ls) — List fonts in collections
|
|
188
|
+
- [tables](/cli/tables) — Show OpenType table directory
|
|
189
|
+
- [glyphs](/cli/glyphs) — List glyph names and indices
|
|
190
|
+
- [unicode](/cli/unicode) — Show Unicode character mappings
|
|
191
|
+
- [scripts](/cli/scripts) — List supported writing scripts
|
|
192
|
+
- [features](/cli/features) — List OpenType layout features
|
|
193
|
+
- [variable](/cli/variable) — Show variable font axes and instances
|
|
194
|
+
- [optical-size](/cli/optical-size) — Display optical size information
|
|
195
|
+
|
|
196
|
+
### Font Operations
|
|
197
|
+
- [convert](/cli/convert) — Format conversion (TTF, OTF, WOFF, WOFF2)
|
|
198
|
+
- [subset](/cli/subset) — Create character subsets
|
|
199
|
+
- [validate](/cli/validate) — Validate fonts against profiles
|
|
200
|
+
- [instance](/cli/instance) — Generate static instances from variable fonts
|
|
201
|
+
- [export](/cli/export) — Export to TTX, YAML, JSON
|
|
202
|
+
- [dump-table](/cli/dump-table) — Extract raw binary table data
|
|
203
|
+
|
|
204
|
+
### Collection Operations
|
|
205
|
+
- [pack](/cli/pack) — Create and extract font collections (TTC/OTC)
|
|
206
|
+
|
|
207
|
+
### Utilities
|
|
208
|
+
- [version](/cli/version) — Show Fontisan version
|
data/docs/cli/info.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: info
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# info
|
|
6
|
+
|
|
7
|
+
Get comprehensive font information.
|
|
8
|
+
|
|
9
|
+
## Quick Reference
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
fontisan info <font> [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
| Option | Description |
|
|
18
|
+
|--------|-------------|
|
|
19
|
+
| `--format FORMAT` | Output format (text, yaml, json) |
|
|
20
|
+
| `--brief` | Fast mode - essential metadata only (5x faster) |
|
|
21
|
+
| `--verbose` | Show all available information |
|
|
22
|
+
| `--tables` | Include table listing |
|
|
23
|
+
| `--features` | Include OpenType features |
|
|
24
|
+
|
|
25
|
+
## Brief Mode
|
|
26
|
+
|
|
27
|
+
For font indexing systems that need to scan thousands of fonts quickly, use the `--brief` flag to get essential metadata only.
|
|
28
|
+
|
|
29
|
+
### Performance Benefits
|
|
30
|
+
|
|
31
|
+
- **5x faster** than full mode by using metadata-only loading
|
|
32
|
+
- **Loads only 6 tables** instead of 15-20 (name, head, hhea, maxp, OS/2, post)
|
|
33
|
+
- **Lower memory usage** through reduced table loading
|
|
34
|
+
- **Optimized for batch processing** of many fonts
|
|
35
|
+
|
|
36
|
+
### Brief Mode Attributes
|
|
37
|
+
|
|
38
|
+
Brief mode populates only the following 13 essential attributes:
|
|
39
|
+
|
|
40
|
+
**Font Identification:**
|
|
41
|
+
- `font_format` - Font format (truetype, cff)
|
|
42
|
+
- `is_variable` - Whether font is variable
|
|
43
|
+
|
|
44
|
+
**Essential Names:**
|
|
45
|
+
- `family_name` - Font family name
|
|
46
|
+
- `subfamily_name` - Font subfamily/style
|
|
47
|
+
- `full_name` - Full font name
|
|
48
|
+
- `postscript_name` - PostScript name
|
|
49
|
+
|
|
50
|
+
**Version Info:**
|
|
51
|
+
- `version` - Version string
|
|
52
|
+
|
|
53
|
+
**Metrics:**
|
|
54
|
+
- `font_revision` - Font revision number
|
|
55
|
+
- `units_per_em` - Units per em
|
|
56
|
+
|
|
57
|
+
**Vendor:**
|
|
58
|
+
- `vendor_id` - Vendor/foundry ID
|
|
59
|
+
|
|
60
|
+
### Brief Mode Examples
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Fast font indexing
|
|
64
|
+
fontisan info font.ttf --brief
|
|
65
|
+
|
|
66
|
+
# Brief mode with JSON output
|
|
67
|
+
fontisan info font.ttf --brief --format json
|
|
68
|
+
|
|
69
|
+
# Process many fonts quickly
|
|
70
|
+
for font in *.ttf; do
|
|
71
|
+
fontisan info "$font" --brief --format json >> fonts.jsonl
|
|
72
|
+
done
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Brief Mode Sample Output
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Font type: TrueType (Variable)
|
|
79
|
+
Family: Mona Sans ExtraLight
|
|
80
|
+
Subfamily: Regular
|
|
81
|
+
Full name: Mona Sans ExtraLight
|
|
82
|
+
PostScript name: MonaSans-ExtraLight
|
|
83
|
+
Version: Version 2.001
|
|
84
|
+
Vendor ID: GTHB
|
|
85
|
+
Font revision: 2.00101
|
|
86
|
+
Units per em: 1000
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Brief Mode JSON Output
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"font_format": "truetype",
|
|
94
|
+
"is_variable": true,
|
|
95
|
+
"family_name": "Mona Sans ExtraLight",
|
|
96
|
+
"subfamily_name": "Regular",
|
|
97
|
+
"full_name": "Mona Sans ExtraLight",
|
|
98
|
+
"postscript_name": "MonaSans-ExtraLight",
|
|
99
|
+
"version": "Version 2.001",
|
|
100
|
+
"font_revision": 2.00101,
|
|
101
|
+
"vendor_id": "GTHB",
|
|
102
|
+
"units_per_em": 1000
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Full Mode
|
|
107
|
+
|
|
108
|
+
Full mode populates additional attributes (remain `nil` in brief mode):
|
|
109
|
+
|
|
110
|
+
- `postscript_cid_name`, `preferred_family`, `preferred_subfamily`, `mac_font_menu_name`
|
|
111
|
+
- `unique_id`, `description`, `designer`, `designer_url`
|
|
112
|
+
- `manufacturer`, `vendor_url`, `trademark`, `copyright`
|
|
113
|
+
- `license_description`, `license_url`, `sample_text`, `permissions`
|
|
114
|
+
|
|
115
|
+
## Output
|
|
116
|
+
|
|
117
|
+
Shows comprehensive font metadata:
|
|
118
|
+
- Family and style names
|
|
119
|
+
- Version and copyright
|
|
120
|
+
- PostScript name
|
|
121
|
+
- Format (TrueType, OpenType, etc.)
|
|
122
|
+
- Glyph count
|
|
123
|
+
- Table count
|
|
124
|
+
- Unicode ranges
|
|
125
|
+
- Variable font axes (if applicable)
|
|
126
|
+
|
|
127
|
+
## Examples
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Basic info
|
|
131
|
+
fontisan info font.ttf
|
|
132
|
+
|
|
133
|
+
# Brief mode for fast indexing
|
|
134
|
+
fontisan info font.ttf --brief
|
|
135
|
+
|
|
136
|
+
# Verbose output
|
|
137
|
+
fontisan info font.ttf --verbose
|
|
138
|
+
|
|
139
|
+
# Include tables
|
|
140
|
+
fontisan info font.ttf --tables
|
|
141
|
+
|
|
142
|
+
# JSON output
|
|
143
|
+
fontisan info font.ttf --format json
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Sample Output
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Font: SourceSans3-Regular.otf
|
|
150
|
+
Format: OpenType (CFF)
|
|
151
|
+
Family: Source Sans 3
|
|
152
|
+
Style: Regular
|
|
153
|
+
PostScript: SourceSans3-Regular
|
|
154
|
+
Version: 3.046
|
|
155
|
+
Copyright: Copyright 2023 Adobe
|
|
156
|
+
|
|
157
|
+
Glyphs: 1,024
|
|
158
|
+
Tables: 18
|
|
159
|
+
Characters: 892
|
|
160
|
+
|
|
161
|
+
Unicode Ranges:
|
|
162
|
+
Basic Latin (95)
|
|
163
|
+
Latin-1 Supplement (96)
|
|
164
|
+
Latin Extended-A (128)
|
|
165
|
+
Greek and Coptic (72)
|
|
166
|
+
|
|
167
|
+
Features: 24
|
|
168
|
+
liga, dlig, kern, mark, mkmk, ...
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Use Cases
|
|
172
|
+
|
|
173
|
+
### Get Family Name
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
fontisan info font.ttf --format json | jq '.family_name'
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Check Font Format
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
fontisan info font.ttf --format json | jq '.format'
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Compare Fonts
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
diff <(fontisan info font1.ttf) <(fontisan info font2.ttf)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Batch Process Fonts (Fast)
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Use brief mode for fast batch processing
|
|
195
|
+
for font in *.ttf; do
|
|
196
|
+
echo "=== $font ==="
|
|
197
|
+
fontisan info "$font" --brief
|
|
198
|
+
done
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Build Font Index
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Create JSON index of all fonts
|
|
205
|
+
echo '[' > fonts.json
|
|
206
|
+
first=true
|
|
207
|
+
for font in **/*.ttf; do
|
|
208
|
+
if $first; then first=false; else echo ',' >> fonts.json; fi
|
|
209
|
+
fontisan info "$font" --brief --format json >> fonts.json
|
|
210
|
+
done
|
|
211
|
+
echo ']' >> fonts.json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Ruby API
|
|
215
|
+
|
|
216
|
+
### Brief Mode
|
|
217
|
+
|
|
218
|
+
```ruby
|
|
219
|
+
require 'fontisan'
|
|
220
|
+
|
|
221
|
+
# Fast metadata-only loading
|
|
222
|
+
info = Fontisan.info("font.ttf", brief: true)
|
|
223
|
+
|
|
224
|
+
# Access populated fields
|
|
225
|
+
puts info.family_name # "Open Sans"
|
|
226
|
+
puts info.postscript_name # "OpenSans-Regular"
|
|
227
|
+
puts info.is_variable # false
|
|
228
|
+
|
|
229
|
+
# Non-essential fields are nil
|
|
230
|
+
puts info.copyright # nil (not populated)
|
|
231
|
+
puts info.designer # nil (not populated)
|
|
232
|
+
|
|
233
|
+
# Serialize to YAML/JSON
|
|
234
|
+
puts info.to_yaml
|
|
235
|
+
puts info.to_json
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Brief Mode for Collections
|
|
239
|
+
|
|
240
|
+
```ruby
|
|
241
|
+
require 'fontisan'
|
|
242
|
+
|
|
243
|
+
# Specify font index for TTC/OTC files
|
|
244
|
+
info = Fontisan.info("/path/to/fonts.ttc", brief: true, font_index: 0)
|
|
245
|
+
puts info.family_name
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Related Commands
|
|
249
|
+
|
|
250
|
+
- [tables](/cli/tables) — Detailed table information
|
|
251
|
+
- [glyphs](/cli/glyphs) — List all glyphs
|
|
252
|
+
- [features](/cli/features) — List OpenType features
|
|
253
|
+
- [variable](/cli/variable) — Variable font details
|
|
254
|
+
- [version](/cli/version) — Show Fontisan version
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: instance
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# instance
|
|
6
|
+
|
|
7
|
+
Generate static font instances from variable fonts.
|
|
8
|
+
|
|
9
|
+
::: warning License Consideration
|
|
10
|
+
Many commercial variable fonts require a special license to generate static instances. Check your font's EULA before using this command.
|
|
11
|
+
:::
|
|
12
|
+
|
|
13
|
+
## Quick Reference
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
fontisan instance <variable-font> [options]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What are Variable Font Instances?
|
|
20
|
+
|
|
21
|
+
Variable fonts contain multiple variations along design axes (weight, width, slant, etc.). The `instance` command extracts a specific variation as a standalone static font.
|
|
22
|
+
|
|
23
|
+
For example, a variable font with a `wght` (weight) axis from 100-900 can generate instances like:
|
|
24
|
+
- Light (wght: 300)
|
|
25
|
+
- Regular (wght: 400)
|
|
26
|
+
- Medium (wght: 500)
|
|
27
|
+
- Bold (wght: 700)
|
|
28
|
+
|
|
29
|
+
## Options
|
|
30
|
+
|
|
31
|
+
| Option | Description |
|
|
32
|
+
|--------|-------------|
|
|
33
|
+
| `--output FILE` | Output file path |
|
|
34
|
+
| `--wght VALUE` | Weight axis value (e.g., 400, 700) |
|
|
35
|
+
| `--wdth VALUE` | Width axis value |
|
|
36
|
+
| `--slnt VALUE` | Slant axis value |
|
|
37
|
+
| `--ital VALUE` | Italic axis value |
|
|
38
|
+
| `--opsz VALUE` | Optical size axis value |
|
|
39
|
+
| `--named INSTANCE` | Use named instance (e.g., "Bold") |
|
|
40
|
+
| `--format FORMAT` | Output format (ttf, otf, woff, woff2) |
|
|
41
|
+
|
|
42
|
+
## Examples
|
|
43
|
+
|
|
44
|
+
### Generate by Axis Values
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Generate Regular weight
|
|
48
|
+
fontisan instance VariableFont.ttf --wght 400 --output Regular.ttf
|
|
49
|
+
|
|
50
|
+
# Generate Bold weight
|
|
51
|
+
fontisan instance VariableFont.ttf --wght 700 --output Bold.ttf
|
|
52
|
+
|
|
53
|
+
# Generate with multiple axes
|
|
54
|
+
fontisan instance VariableFont.ttf --wght 500 --wdth 75 --output MediumCondensed.ttf
|
|
55
|
+
|
|
56
|
+
# Generate with optical size
|
|
57
|
+
fontisan instance VariableFont.ttf --wght 400 --opsz 12 --output Text-12pt.ttf
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Generate by Named Instance
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Use a named instance from the font
|
|
64
|
+
fontisan instance VariableFont.ttf --named "Bold" --output Bold.ttf
|
|
65
|
+
|
|
66
|
+
# List available named instances first
|
|
67
|
+
fontisan variable VariableFont.ttf
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Generate for Web
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Generate and convert to WOFF2 in one step
|
|
74
|
+
fontisan instance VariableFont.ttf --wght 400 --format woff2 --output Regular.woff2
|
|
75
|
+
fontisan instance VariableFont.ttf --wght 700 --format woff2 --output Bold.woff2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Batch Generation
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Generate common weights
|
|
82
|
+
for wght in 300 400 500 600 700; do
|
|
83
|
+
fontisan instance VariableFont.ttf --wght $wght --output Font-$wght.ttf
|
|
84
|
+
done
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Common Axes
|
|
88
|
+
|
|
89
|
+
| Axis Tag | Name | Typical Range |
|
|
90
|
+
|----------|------|---------------|
|
|
91
|
+
| `wght` | Weight | 1-999 (100-900 common) |
|
|
92
|
+
| `wdth` | Width | 0-200 (% of normal) |
|
|
93
|
+
| `slnt` | Slant | -90 to +90 (degrees) |
|
|
94
|
+
| `ital` | Italic | 0-1 |
|
|
95
|
+
| `opsz` | Optical Size | 8-144 (point size) |
|
|
96
|
+
| `GRAD` | Grade | -1 to 1 |
|
|
97
|
+
| `XTRA` | X-height | Various |
|
|
98
|
+
| `XOPQ` | X opaque | Various |
|
|
99
|
+
| `YOPQ` | Y opaque | Various |
|
|
100
|
+
|
|
101
|
+
## Discovering Axes
|
|
102
|
+
|
|
103
|
+
Use the `variable` command to see what axes a font has:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
fontisan variable VariableFont.ttf
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Output shows:
|
|
110
|
+
- Available axes with their ranges
|
|
111
|
+
- Named instances defined in the font
|
|
112
|
+
- Default values
|
|
113
|
+
|
|
114
|
+
## Detailed Documentation
|
|
115
|
+
|
|
116
|
+
For comprehensive documentation including:
|
|
117
|
+
- How variable fonts work
|
|
118
|
+
- Instance generation algorithms
|
|
119
|
+
- Handling complex axes
|
|
120
|
+
- Format conversion options
|
|
121
|
+
|
|
122
|
+
See the [Variable Fonts Guide](/guide/variable-fonts/).
|
data/docs/cli/ls.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ls
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# ls
|
|
6
|
+
|
|
7
|
+
List fonts in a collection.
|
|
8
|
+
|
|
9
|
+
## Quick Reference
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
fontisan ls <collection> [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
| Option | Description |
|
|
18
|
+
|--------|-------------|
|
|
19
|
+
| `--format FORMAT` | Output format (text, yaml, json) |
|
|
20
|
+
| `--verbose` | Show detailed information |
|
|
21
|
+
|
|
22
|
+
## Supported Collections
|
|
23
|
+
|
|
24
|
+
- TTC (TrueType Collection)
|
|
25
|
+
- OTC (OpenType Collection)
|
|
26
|
+
- dfont (Apple Data Fork Font)
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# List fonts in a TTC
|
|
32
|
+
fontisan ls fonts.ttc
|
|
33
|
+
|
|
34
|
+
# List fonts in a dfont
|
|
35
|
+
fontisan ls fonts.dfont
|
|
36
|
+
|
|
37
|
+
# JSON output
|
|
38
|
+
fontisan ls fonts.ttc --format json
|
|
39
|
+
|
|
40
|
+
# Verbose output
|
|
41
|
+
fontisan ls fonts.ttc --verbose
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Sample Output
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Collection: fonts.ttc
|
|
48
|
+
Fonts: 4
|
|
49
|
+
|
|
50
|
+
0. Noto Serif CJK JP
|
|
51
|
+
PostScript: NotoSerifCJKJP-Regular
|
|
52
|
+
Format: OpenType
|
|
53
|
+
Glyphs: 65,535
|
|
54
|
+
|
|
55
|
+
1. Noto Serif CJK KR
|
|
56
|
+
PostScript: NotoSerifCJKKR-Regular
|
|
57
|
+
Format: OpenType
|
|
58
|
+
Glyphs: 65,535
|
|
59
|
+
|
|
60
|
+
2. Noto Serif CJK SC
|
|
61
|
+
PostScript: NotoSerifCJKSC-Regular
|
|
62
|
+
Format: OpenType
|
|
63
|
+
Glyphs: 65,535
|
|
64
|
+
|
|
65
|
+
3. Noto Serif CJK TC
|
|
66
|
+
PostScript: NotoSerifCJKTC-Regular
|
|
67
|
+
Format: OpenType
|
|
68
|
+
Glyphs: 65,535
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Use Cases
|
|
72
|
+
|
|
73
|
+
### Count Fonts in Collection
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
fontisan ls fonts.ttc | grep -c "PostScript"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Get Font Index for Extraction
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Find the index of a specific font
|
|
83
|
+
fontisan ls fonts.ttc | grep -n "Bold"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Extract Collection Info to JSON
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
fontisan ls fonts.ttc --format json > collection-info.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Related Commands
|
|
93
|
+
|
|
94
|
+
- [pack/unpack](/cli/pack) — Create and extract collections
|
|
95
|
+
- [info](/cli/info) — Get detailed font information
|