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.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +79 -4
  3. data/docs/.gitignore +17 -0
  4. data/docs/.vitepress/config.ts +317 -0
  5. data/docs/.vitepress/theme/components/ApiMethod.vue +127 -0
  6. data/docs/.vitepress/theme/components/Badge.vue +51 -0
  7. data/docs/.vitepress/theme/components/FeatureComparison.vue +87 -0
  8. data/docs/.vitepress/theme/components/HeroCodeBlock.vue +98 -0
  9. data/docs/.vitepress/theme/components/WithinHero.vue +30 -0
  10. data/docs/.vitepress/theme/index.ts +22 -0
  11. data/docs/.vitepress/theme/style.css +330 -0
  12. data/docs/api/conversion-options.md +141 -0
  13. data/docs/api/converters/curve-converter.md +34 -0
  14. data/docs/api/converters/hint-converter.md +34 -0
  15. data/docs/api/converters/outline-converter.md +27 -0
  16. data/docs/api/font-loader.md +111 -0
  17. data/docs/api/font-writer.md +103 -0
  18. data/docs/api/index.md +79 -0
  19. data/docs/api/models/glyph-accessor.md +43 -0
  20. data/docs/api/models/glyph.md +40 -0
  21. data/docs/api/models/table-analyzer.md +35 -0
  22. data/docs/api/sfnt-font.md +53 -0
  23. data/docs/api/type1-font.md +43 -0
  24. data/docs/api/validators/font-validator.md +31 -0
  25. data/docs/api/validators/helper.md +36 -0
  26. data/docs/api/validators/profile.md +39 -0
  27. data/docs/cli/convert.md +87 -0
  28. data/docs/cli/dump-table.md +110 -0
  29. data/docs/cli/export.md +176 -0
  30. data/docs/cli/features.md +124 -0
  31. data/docs/cli/glyphs.md +90 -0
  32. data/docs/cli/index.md +208 -0
  33. data/docs/cli/info.md +254 -0
  34. data/docs/cli/instance.md +122 -0
  35. data/docs/cli/ls.md +95 -0
  36. data/docs/cli/optical-size.md +94 -0
  37. data/docs/cli/pack.md +125 -0
  38. data/docs/cli/scripts.md +105 -0
  39. data/docs/cli/subset.md +39 -0
  40. data/docs/cli/tables.md +84 -0
  41. data/docs/cli/unicode.md +101 -0
  42. data/docs/cli/validate.md +48 -0
  43. data/docs/cli/variable.md +126 -0
  44. data/docs/cli/version.md +46 -0
  45. data/docs/guide/cli/convert.md +108 -0
  46. data/docs/guide/cli/export.md +138 -0
  47. data/docs/guide/cli/index.md +99 -0
  48. data/docs/guide/cli/info.md +144 -0
  49. data/docs/guide/cli/pack.md +155 -0
  50. data/docs/guide/cli/subset.md +118 -0
  51. data/docs/guide/cli/validate.md +139 -0
  52. data/docs/guide/color-fonts/bitmaps.md +177 -0
  53. data/docs/guide/color-fonts/colr-cpal.md +175 -0
  54. data/docs/guide/color-fonts/index.md +140 -0
  55. data/docs/guide/color-fonts/svg.md +154 -0
  56. data/docs/guide/color.md +51 -0
  57. data/docs/guide/comparisons/font-validator.md +222 -0
  58. data/docs/guide/comparisons/fonttools.md +200 -0
  59. data/docs/guide/comparisons/index.md +83 -0
  60. data/docs/guide/comparisons/lcdf-typetools.md +205 -0
  61. data/docs/guide/contributing.md +279 -0
  62. data/docs/guide/conversion/collections.md +251 -0
  63. data/docs/guide/conversion/curves.md +246 -0
  64. data/docs/guide/conversion/index.md +157 -0
  65. data/docs/guide/conversion/options.md +251 -0
  66. data/docs/guide/conversion/ttf-otf.md +184 -0
  67. data/docs/guide/conversion/type1.md +208 -0
  68. data/docs/guide/conversion/web.md +240 -0
  69. data/docs/guide/conversion.md +39 -0
  70. data/docs/guide/formats/collections.md +147 -0
  71. data/docs/guide/formats/dfont.md +99 -0
  72. data/docs/guide/formats/index.md +65 -0
  73. data/docs/guide/formats/otf.md +103 -0
  74. data/docs/guide/formats/svg.md +97 -0
  75. data/docs/guide/formats/ttf.md +105 -0
  76. data/docs/guide/formats/type1.md +118 -0
  77. data/docs/guide/formats/woff.md +115 -0
  78. data/docs/guide/hinting/autohint.md +141 -0
  79. data/docs/guide/hinting/conversion.md +161 -0
  80. data/docs/guide/hinting/index.md +86 -0
  81. data/docs/guide/hinting/postscript.md +149 -0
  82. data/docs/guide/hinting/truetype.md +135 -0
  83. data/docs/guide/hinting.md +44 -0
  84. data/docs/guide/index.md +152 -0
  85. data/docs/guide/installation.md +116 -0
  86. data/docs/guide/migrations/extract-ttc.md +549 -0
  87. data/docs/guide/migrations/font-validator.md +260 -0
  88. data/docs/guide/migrations/fonttools.md +208 -0
  89. data/docs/guide/migrations/index.md +64 -0
  90. data/docs/guide/migrations/otfinfo.md +197 -0
  91. data/docs/guide/quick-start.md +204 -0
  92. data/docs/guide/type1.md +58 -0
  93. data/docs/guide/universal-outline.md +151 -0
  94. data/docs/guide/validation/custom.md +195 -0
  95. data/docs/guide/validation/helpers.md +188 -0
  96. data/docs/guide/validation/index.md +132 -0
  97. data/docs/guide/validation/profiles.md +156 -0
  98. data/docs/guide/validation.md +47 -0
  99. data/docs/guide/variable-fonts/advanced.md +231 -0
  100. data/docs/guide/variable-fonts/axes.md +209 -0
  101. data/docs/guide/variable-fonts/conversion.md +197 -0
  102. data/docs/guide/variable-fonts/index.md +84 -0
  103. data/docs/guide/variable-fonts/instances.md +187 -0
  104. data/docs/guide/variable-fonts/named-instances.md +194 -0
  105. data/docs/guide/variable-fonts/static.md +168 -0
  106. data/docs/guide/variable.md +58 -0
  107. data/docs/guide/woff.md +59 -0
  108. data/docs/index.md +136 -0
  109. data/docs/lychee.toml +37 -0
  110. data/docs/package-lock.json +2560 -0
  111. data/docs/package.json +15 -0
  112. data/docs/public/apple-touch-icon.png +0 -0
  113. data/docs/public/favicon-96x96.png +0 -0
  114. data/docs/public/favicon.ico +0 -0
  115. data/docs/public/favicon.svg +1 -0
  116. data/docs/public/logo-full.svg +1 -0
  117. data/docs/public/logo.svg +1 -0
  118. data/docs/public/site.webmanifest +21 -0
  119. data/docs/public/web-app-manifest-192x192.png +0 -0
  120. data/docs/public/web-app-manifest-512x512.png +0 -0
  121. data/fontisan.gemspec +1 -1
  122. data/lib/fontisan/commands/features_command.rb +0 -1
  123. data/lib/fontisan/commands/scripts_command.rb +0 -1
  124. data/lib/fontisan/loading_modes.rb +0 -2
  125. data/lib/fontisan/sfnt_font.rb +4 -3
  126. data/lib/fontisan/tables/glyf/compound_glyph.rb +0 -1
  127. data/lib/fontisan/variable/delta_applicator.rb +3 -3
  128. data/lib/fontisan/variation/optimizer.rb +0 -1
  129. data/lib/fontisan/version.rb +1 -1
  130. data/lib/fontisan.rb +3 -2
  131. metadata +122 -4
@@ -0,0 +1,87 @@
1
+ ---
2
+ title: convert
3
+ ---
4
+
5
+ # convert
6
+
7
+ Convert individual fonts between different formats.
8
+
9
+ ::: tip For Collection Formats
10
+ Use [pack/unpack](/cli/pack) to work with TTC, OTC, and dfont collections. The convert command is for individual font files only.
11
+ :::
12
+
13
+ ## Quick Reference
14
+
15
+ ```bash
16
+ fontisan convert <input> --to <format> [options]
17
+ ```
18
+
19
+ ## Supported Formats
20
+
21
+ These are individual font formats that can be converted:
22
+
23
+ | Format | Read | Write | Description |
24
+ |--------|:----:|:-----:|-------------|
25
+ | TTF | ✅ | ✅ | TrueType (glyf outlines) |
26
+ | OTF | ✅ | ✅ | OpenType (CFF outlines) |
27
+ | WOFF | ✅ | ✅ | Web Open Font Format |
28
+ | WOFF2 | ✅ | ✅ | Web Open Font Format 2 |
29
+ | PFB/PFA | ✅ | — | Adobe Type 1 (read for conversion) |
30
+
31
+ ## Options
32
+
33
+ | Option | Description |
34
+ |--------|-------------|
35
+ | `--to FORMAT` | Target format (ttf, otf, woff, woff2) |
36
+ | `--output FILE` | Output file path |
37
+ | `--optimize` | Enable outline optimization |
38
+ | `--flatten` | Flatten composite glyphs |
39
+
40
+ ## Common Workflows
41
+
42
+ ### Convert for Web
43
+
44
+ ```bash
45
+ # TTF to WOFF2 (recommended for modern browsers)
46
+ fontisan convert font.ttf --to woff2 --output font.woff2
47
+
48
+ # OTF to WOFF (broader compatibility)
49
+ fontisan convert font.otf --to woff --output font.woff
50
+ ```
51
+
52
+ ### Convert Between Outline Formats
53
+
54
+ ```bash
55
+ # TrueType to OpenType (glyf → CFF)
56
+ fontisan convert font.ttf --to otf --output font.otf
57
+
58
+ # OpenType to TrueType (CFF → glyf)
59
+ fontisan convert font.otf --to ttf --output font.ttf
60
+ ```
61
+
62
+ ### Convert Legacy Type 1 Fonts
63
+
64
+ ```bash
65
+ # Type 1 to OpenType
66
+ fontisan convert font.pfb --to otf --output font.otf
67
+ ```
68
+
69
+ ## Working with Collections
70
+
71
+ Collection formats (TTC, OTC, dfont) contain multiple fonts. To convert fonts from a collection:
72
+
73
+ ```bash
74
+ # Step 1: Extract fonts from collection
75
+ fontisan unpack family.ttc --output-dir ./extracted
76
+
77
+ # Step 2: Convert each font
78
+ fontisan convert ./extracted/Font-Regular.ttf --to woff2 --output Font-Regular.woff2
79
+ fontisan convert ./extracted/Font-Bold.ttf --to woff2 --output Font-Bold.woff2
80
+
81
+ # Or extract and convert in one step:
82
+ fontisan unpack family.ttc --output-dir ./web --format woff2
83
+ ```
84
+
85
+ ## Detailed Documentation
86
+
87
+ For comprehensive documentation including curve conversion, hint handling, and advanced options, see the [convert command guide](/guide/cli/convert).
@@ -0,0 +1,110 @@
1
+ ---
2
+ title: dump-table
3
+ ---
4
+
5
+ # dump-table
6
+
7
+ Extract raw table data from a font.
8
+
9
+ ## Quick Reference
10
+
11
+ ```bash
12
+ fontisan dump-table <font> <table-tag> [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ | Option | Description |
18
+ |--------|-------------|
19
+ | `--output FILE` | Output file (default: stdout) |
20
+ | `--hex` | Output as hexadecimal |
21
+ | `--json` | Parse and output as JSON |
22
+
23
+ ## Output
24
+
25
+ Outputs raw binary table data, or parsed data if `--json` is specified.
26
+
27
+ ## Examples
28
+
29
+ ### Raw Binary Output
30
+
31
+ ```bash
32
+ # Dump head table to file
33
+ fontisan dump-table font.ttf head --output head.bin
34
+
35
+ # Dump cmap table
36
+ fontisan dump-table font.ttf cmap --output cmap.bin
37
+ ```
38
+
39
+ ### Hexadecimal Output
40
+
41
+ ```bash
42
+ # View as hex
43
+ fontisan dump-table font.ttf head --hex
44
+ ```
45
+
46
+ ### Parsed JSON Output
47
+
48
+ ```bash
49
+ # Get parsed table data
50
+ fontisan dump-table font.ttf head --json
51
+
52
+ # Extract specific values
53
+ fontisan dump-table font.ttf head --json | jq '.unitsPerEm'
54
+ ```
55
+
56
+ ## Common Tables to Dump
57
+
58
+ | Table | Contains |
59
+ |-------|----------|
60
+ | `head` | Font header, units per em, bbox |
61
+ | `name` | All naming strings |
62
+ | `cmap` | Character to glyph mapping |
63
+ | `glyf` | Glyph outlines (TrueType) |
64
+ | `CFF ` | Compact font format data |
65
+ | `maxp` | Maximum profile |
66
+ | `hhea` | Horizontal header |
67
+ | `OS/2` | OS/2 metrics |
68
+ | `post` | PostScript names |
69
+ | `GPOS` | Glyph positioning |
70
+ | `GSUB` | Glyph substitution |
71
+ | `fvar` | Variation axes |
72
+ | `STAT` | Style attributes |
73
+
74
+ ## Use Cases
75
+
76
+ ### Debug Font Issues
77
+
78
+ ```bash
79
+ # Check head table values
80
+ fontisan dump-table font.ttf head --json
81
+ ```
82
+
83
+ ### Extract Naming Data
84
+
85
+ ```bash
86
+ # Get all name strings
87
+ fontisan dump-table font.ttf name --json > names.json
88
+ ```
89
+
90
+ ### Compare Tables Between Fonts
91
+
92
+ ```bash
93
+ # Compare head tables
94
+ diff <(fontisan dump-table font1.ttf head --hex) \
95
+ <(fontisan dump-table font2.ttf head --hex)
96
+ ```
97
+
98
+ ### Backup Table Data
99
+
100
+ ```bash
101
+ # Backup critical tables
102
+ fontisan dump-table font.ttf head --output backup/head.bin
103
+ fontisan dump-table font.ttf name --output backup/name.bin
104
+ fontisan dump-table font.ttf cmap --output backup/cmap.bin
105
+ ```
106
+
107
+ ## Related Commands
108
+
109
+ - [tables](/cli/tables) — List all tables
110
+ - [export](/cli/export) — Export to TTX, SVG, etc.
@@ -0,0 +1,176 @@
1
+ ---
2
+ title: export
3
+ ---
4
+
5
+ # export
6
+
7
+ Export font data to various formats for analysis, debugging, or conversion.
8
+
9
+ ## Quick Reference
10
+
11
+ ```bash
12
+ fontisan export <font> --format <format> [options]
13
+ ```
14
+
15
+ ## Export Formats
16
+
17
+ | Format | Description | Use Case |
18
+ |--------|-------------|----------|
19
+ | `ttx` | XML-based TTX format | Debugging, inspection |
20
+ | `svg` | SVG font | Web graphics |
21
+ | `json` | JSON representation | Data processing |
22
+ | `yaml` | YAML representation | Human-readable output |
23
+
24
+ ## Options
25
+
26
+ | Option | Description |
27
+ |--------|-------------|
28
+ | `--format FORMAT` | Export format (ttx, svg, json, yaml) |
29
+ | `--output FILE` | Output file path |
30
+ | `--tables LIST` | Export specific tables only (comma-separated) |
31
+ | `--pretty` | Pretty-print output (JSON, YAML) |
32
+ | `--glyphs` | Include glyph outlines (SVG) |
33
+
34
+ ## Examples
35
+
36
+ ### Export to TTX
37
+
38
+ TTX is an XML representation of font tables, useful for debugging and inspection.
39
+
40
+ ```bash
41
+ # Export entire font
42
+ fontisan export font.ttf --format ttx --output font.ttx
43
+
44
+ # Export specific tables
45
+ fontisan export font.ttf --format ttx --tables head,name,cmap --output partial.ttx
46
+
47
+ # Export single table
48
+ fontisan export font.ttf --format ttx --tables glyf --output glyf.ttx
49
+ ```
50
+
51
+ ### Export to SVG
52
+
53
+ ```bash
54
+ # Export as SVG font
55
+ fontisan export font.ttf --format svg --output font.svg
56
+
57
+ # Include all glyphs
58
+ fontisan export font.ttf --format svg --glyphs --output font-glyphs.svg
59
+ ```
60
+
61
+ ### Export to JSON/YAML
62
+
63
+ ```bash
64
+ # JSON output
65
+ fontisan export font.ttf --format json --output font.json
66
+
67
+ # Pretty-printed JSON
68
+ fontisan export font.ttf --format json --pretty --output font-pretty.json
69
+
70
+ # YAML output
71
+ fontisan export font.ttf --format yaml --output font.yaml
72
+ ```
73
+
74
+ ## TTX Format
75
+
76
+ TTX is Adobe's XML format for font tables. It's human-readable and diffable.
77
+
78
+ ### Sample TTX Output
79
+
80
+ ```xml
81
+ <?xml version="1.0" encoding="UTF-8"?>
82
+ <ttFont sfntVersion="OTTO" ttLibVersion="4.0">
83
+ <head>
84
+ <tableVersion value="1.0"/>
85
+ <fontRevision value="3.046"/>
86
+ <checkSumAdjustment value="0"/>
87
+ <unitsPerEm value="1000"/>
88
+ ...
89
+ </head>
90
+ <name>
91
+ <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
92
+ Source Sans 3
93
+ </namerecord>
94
+ ...
95
+ </name>
96
+ </ttFont>
97
+ ```
98
+
99
+ ## SVG Font Format
100
+
101
+ SVG fonts define glyphs as SVG paths, usable in web contexts.
102
+
103
+ ### Sample SVG Output
104
+
105
+ ```xml
106
+ <?xml version="1.0" encoding="UTF-8"?>
107
+ <svg xmlns="http://www.w3.org/2000/svg">
108
+ <font id="MyFont" horiz-adv-x="500">
109
+ <font-face font-family="My Font" units-per-em="1000"/>
110
+ <glyph unicode="A" d="M100 0 L200 700 L300 0 Z"/>
111
+ ...
112
+ </font>
113
+ </svg>
114
+ ```
115
+
116
+ ## JSON/YAML Output
117
+
118
+ Structured output for programmatic access.
119
+
120
+ ### Sample JSON Output
121
+
122
+ ```json
123
+ {
124
+ "format": "OpenType",
125
+ "family": "Source Sans 3",
126
+ "style": "Regular",
127
+ "version": "3.046",
128
+ "glyphs": 1024,
129
+ "tables": {
130
+ "head": { "unitsPerEm": 1000, ... },
131
+ "name": { "records": [...] },
132
+ ...
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## Use Cases
138
+
139
+ ### Debug Font Issues
140
+
141
+ ```bash
142
+ # Export and search for issues
143
+ fontisan export font.ttf --format ttx --output debug.ttx
144
+ grep -i "error\|warning" debug.ttx
145
+ ```
146
+
147
+ ### Compare Fonts
148
+
149
+ ```bash
150
+ # Export both fonts
151
+ fontisan export font1.ttf --format ttx --output font1.ttx
152
+ fontisan export font2.ttf --format ttx --output font2.ttx
153
+
154
+ # Compare
155
+ diff font1.ttx font2.ttx
156
+ ```
157
+
158
+ ### Extract Font Data
159
+
160
+ ```bash
161
+ # Get font metadata as JSON
162
+ fontisan export font.ttf --format json | jq '.family, .style, .version'
163
+ ```
164
+
165
+ ### Create SVG Glyphs
166
+
167
+ ```bash
168
+ # Export individual glyphs for web use
169
+ fontisan export font.ttf --format svg --glyphs --output glyphs.svg
170
+ ```
171
+
172
+ ## Related Commands
173
+
174
+ - [tables](/cli/tables) — List font tables
175
+ - [dump-table](/cli/dump-table) — Extract raw table data
176
+ - [convert](/cli/convert) — Convert font formats
@@ -0,0 +1,124 @@
1
+ ---
2
+ title: features
3
+ ---
4
+
5
+ # features
6
+
7
+ List OpenType features in a font.
8
+
9
+ ## Quick Reference
10
+
11
+ ```bash
12
+ fontisan features <font> [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ | Option | Description |
18
+ |--------|-------------|
19
+ | `--format FORMAT` | Output format (text, yaml, json) |
20
+ | `--script TAG` | Filter by script |
21
+ | `--language TAG` | Filter by language |
22
+ | `--detail` | Show feature details |
23
+
24
+ ## Output
25
+
26
+ Shows:
27
+ - Feature tags
28
+ - Feature names/descriptions
29
+ - Scripts that use each feature
30
+ - Lookup count
31
+
32
+ ## Examples
33
+
34
+ ```bash
35
+ # List all features
36
+ fontisan features font.ttf
37
+
38
+ # Features for specific script
39
+ fontisan features font.ttf --script latn
40
+
41
+ # With details
42
+ fontisan features font.ttf --detail
43
+
44
+ # JSON output
45
+ fontisan features font.ttf --format json
46
+ ```
47
+
48
+ ## Sample Output
49
+
50
+ ```
51
+ OpenType Features
52
+ =================
53
+
54
+ Tag Name Scripts Lookups
55
+ ------ ---------------------- --------- -------
56
+ liga Standard Ligatures latn,cyrl 12
57
+ dlig Discretionary Ligatures latn 4
58
+ kern Kerning all 156
59
+ mark Mark Positioning all 48
60
+ mkmk Mark to Mark all 24
61
+ onum Oldstyle Figures latn 1
62
+ pnum Proportional Figures latn 1
63
+ tnum Tabular Figures latn 1
64
+ zero Slashed Zero latn 1
65
+
66
+ Total: 9 features
67
+ ```
68
+
69
+ ## Common Feature Tags
70
+
71
+ ### GSUB (Substitution) Features
72
+
73
+ | Tag | Name | Description |
74
+ |-----|------|-------------|
75
+ | `liga` | Standard Ligatures | fi, fl, etc. |
76
+ | `dlig` | Discretionary Ligatures | Optional ligatures |
77
+ | `hlig` | Historical Ligatures | Archaic forms |
78
+ | `calt` | Contextual Alternates | Context-based |
79
+ | `salt` | Stylistic Alternates | Alternate glyphs |
80
+ | `ss01`-`ss20` | Stylistic Sets | Grouped alternates |
81
+ | `smcp` | Small Capitals | Lowercase to small caps |
82
+ | `c2sc` | Caps to Small Caps | Uppercase to small caps |
83
+ | `onum` | Oldstyle Figures | Varying height |
84
+ | `lnum` | Lining Figures | Uniform height |
85
+ | `pnum` | Proportional Figures | Varying width |
86
+ | `tnum` | Tabular Figures | Uniform width |
87
+ | `zero` | Slashed Zero | Distinguish 0/O |
88
+ | `case` | Case-Sensitive Forms | Uppercase adjustment |
89
+
90
+ ### GPOS (Positioning) Features
91
+
92
+ | Tag | Name | Description |
93
+ |-----|------|-------------|
94
+ | `kern` | Kerning | Pair adjustments |
95
+ | `mark` | Mark Positioning | Diacritics |
96
+ | `mkmk` | Mark to Mark | Stacked diacritics |
97
+ | `dist` | Distances | Spacing |
98
+ | `abvm` | Above Marks | Positioning above |
99
+ | `blwm` | Below Marks | Positioning below |
100
+
101
+ ## Use Cases
102
+
103
+ ### Check for Ligatures
104
+
105
+ ```bash
106
+ fontisan features font.ttf | grep liga
107
+ ```
108
+
109
+ ### Check for Small Caps
110
+
111
+ ```bash
112
+ fontisan features font.ttf | grep -E "smcp|c2sc"
113
+ ```
114
+
115
+ ### Compare Feature Sets
116
+
117
+ ```bash
118
+ diff <(fontisan features font1.ttf) <(fontisan features font2.ttf)
119
+ ```
120
+
121
+ ## Related Commands
122
+
123
+ - [scripts](/cli/scripts) — List supported scripts
124
+ - [info](/cli/info) — Get comprehensive font info
@@ -0,0 +1,90 @@
1
+ ---
2
+ title: glyphs
3
+ ---
4
+
5
+ # glyphs
6
+
7
+ List and inspect glyphs in a font.
8
+
9
+ ## Quick Reference
10
+
11
+ ```bash
12
+ fontisan glyphs <font> [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ | Option | Description |
18
+ |--------|-------------|
19
+ | `--format FORMAT` | Output format (text, yaml, json) |
20
+ | `--with-unicode` | Include Unicode codepoints |
21
+ | `--with-bbox` | Include bounding boxes |
22
+ | `--filter PATTERN` | Filter by glyph name pattern |
23
+
24
+ ## Output
25
+
26
+ Lists all glyphs with:
27
+ - Glyph ID (GID)
28
+ - Glyph name
29
+ - Unicode codepoint (if mapped)
30
+ - Bounding box (optional)
31
+
32
+ ## Examples
33
+
34
+ ```bash
35
+ # List all glyphs
36
+ fontisan glyphs font.ttf
37
+
38
+ # With Unicode codepoints
39
+ fontisan glyphs font.ttf --with-unicode
40
+
41
+ # With bounding boxes
42
+ fontisan glyphs font.ttf --with-bbox
43
+
44
+ # Filter by name pattern
45
+ fontisan glyphs font.ttf --filter "uni*"
46
+
47
+ # JSON output for processing
48
+ fontisan glyphs font.ttf --format json > glyphs.json
49
+ ```
50
+
51
+ ## Sample Output
52
+
53
+ ```
54
+ GID Name Unicode Bounding Box
55
+ ---- ---------------- --------- ---------------
56
+ 0 .notdef - (0, 0, 500, 700)
57
+ 1 space U+0020 (0, 0, 0, 0)
58
+ 2 exclam U+0021 (100, 0, 200, 700)
59
+ 3 quotedbl U+0022 (80, 450, 420, 700)
60
+ 4 numbersign U+0023 (30, 0, 470, 700)
61
+ ...
62
+ ```
63
+
64
+ ## Use Cases
65
+
66
+ ### Count Glyphs
67
+
68
+ ```bash
69
+ fontisan glyphs font.ttf | wc -l
70
+ ```
71
+
72
+ ### Find Specific Glyphs
73
+
74
+ ```bash
75
+ # Find ligatures
76
+ fontisan glyphs font.ttf | grep "_"
77
+
78
+ # Find small caps
79
+ fontisan glyphs font.ttf | grep "\.sc"
80
+ ```
81
+
82
+ ### Export Glyph List
83
+
84
+ ```bash
85
+ fontisan glyphs font.ttf --format json --with-unicode > glyph-map.json
86
+ ```
87
+
88
+ ## Detailed Documentation
89
+
90
+ For glyph access via the Ruby API, see the [GlyphAccessor API](/api/models/glyph-accessor).