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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Color Fonts Overview
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Color Fonts Overview
|
|
6
|
+
|
|
7
|
+
Fontisan supports multiple color font formats for modern typography.
|
|
8
|
+
|
|
9
|
+
## Supported Formats
|
|
10
|
+
|
|
11
|
+
| Format | Tables | Description |
|
|
12
|
+
|--------|--------|-------------|
|
|
13
|
+
| COLR/CPAL | COLR, CPAL | Layered vector glyphs |
|
|
14
|
+
| sbix | sbix | Bitmap images (Apple) |
|
|
15
|
+
| CBDT/CBLC | CBDT, CBLC | Bitmap images (Google) |
|
|
16
|
+
| SVG | SVG | SVG embedded in font |
|
|
17
|
+
|
|
18
|
+
## COLR/CPAL
|
|
19
|
+
|
|
20
|
+
COLR/CPAL uses layered vector glyphs with palette-based coloring.
|
|
21
|
+
|
|
22
|
+
### Advantages
|
|
23
|
+
|
|
24
|
+
- **Scalable** — Vectors scale to any size
|
|
25
|
+
- **Small file size** — Efficient compression
|
|
26
|
+
- **Variable support** — Works with variable fonts
|
|
27
|
+
- **Wide support** — Modern browsers and apps
|
|
28
|
+
|
|
29
|
+
### Structure
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
COLR table:
|
|
33
|
+
- Glyph layers (which glyphs make up each color glyph)
|
|
34
|
+
- Layer order (back to front)
|
|
35
|
+
|
|
36
|
+
CPAL table:
|
|
37
|
+
- Color palettes (sets of colors)
|
|
38
|
+
- Color values (RGBA for each palette entry)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## sbix
|
|
42
|
+
|
|
43
|
+
sbix stores bitmap images at multiple resolutions (Apple format).
|
|
44
|
+
|
|
45
|
+
### Advantages
|
|
46
|
+
|
|
47
|
+
- **Photo-realistic** — Any image quality
|
|
48
|
+
- **Multiple sizes** — Different bitmaps for different sizes
|
|
49
|
+
|
|
50
|
+
### Structure
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
sbix table:
|
|
54
|
+
- Strikes (image sets at different sizes)
|
|
55
|
+
- Per-glyph images (PNG, JPG, etc.)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## CBDT/CBLC
|
|
59
|
+
|
|
60
|
+
CBDT/CBLC stores bitmap images (Google/Android format).
|
|
61
|
+
|
|
62
|
+
### Advantages
|
|
63
|
+
|
|
64
|
+
- **Android support** — Primary Android bitmap format
|
|
65
|
+
- **Multiple sizes** — Different bitmaps per ppem
|
|
66
|
+
|
|
67
|
+
### Structure
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
CBLC table:
|
|
71
|
+
- Location data (where each bitmap is)
|
|
72
|
+
- Size information
|
|
73
|
+
|
|
74
|
+
CBDT table:
|
|
75
|
+
- Bitmap data (actual images)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## SVG Color Fonts
|
|
79
|
+
|
|
80
|
+
SVG fonts embed complete SVG documents.
|
|
81
|
+
|
|
82
|
+
### Advantages
|
|
83
|
+
|
|
84
|
+
- **Full SVG features** — Gradients, effects, etc.
|
|
85
|
+
- **Standalone** — No external resources
|
|
86
|
+
|
|
87
|
+
### Limitations
|
|
88
|
+
|
|
89
|
+
- **Large file size** — XML overhead
|
|
90
|
+
- **Limited support** — Not all browsers
|
|
91
|
+
|
|
92
|
+
## Guides
|
|
93
|
+
|
|
94
|
+
- [COLR/CPAL](/guide/color-fonts/colr-cpal) — Vector layered color fonts
|
|
95
|
+
- [Bitmaps](/guide/color-fonts/bitmaps) — sbix and CBDT/CBLC
|
|
96
|
+
- [SVG Color](/guide/color-fonts/svg) — SVG-based color fonts
|
|
97
|
+
|
|
98
|
+
## Quick Start
|
|
99
|
+
|
|
100
|
+
### Check for Color Tables
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
font = Fontisan::FontLoader.load('font.ttf')
|
|
104
|
+
|
|
105
|
+
if font.tables['COLR']
|
|
106
|
+
puts "COLR/CPAL color font"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if font.tables['sbix']
|
|
110
|
+
puts "sbix bitmap font"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if font.tables['CBDT']
|
|
114
|
+
puts "CBDT/CBLC bitmap font"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if font.tables['SVG']
|
|
118
|
+
puts "SVG color font"
|
|
119
|
+
end
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Get Color Information
|
|
123
|
+
|
|
124
|
+
```ruby
|
|
125
|
+
colr = font.tables['COLR']
|
|
126
|
+
cpal = font.tables['CPAL']
|
|
127
|
+
|
|
128
|
+
if colr && cpal
|
|
129
|
+
# Get base glyphs (color emoji)
|
|
130
|
+
colr.base_glyphs.each do |glyph_id|
|
|
131
|
+
puts "Base glyph: #{glyph_id}"
|
|
132
|
+
puts " Layers: #{colr.layers_for(glyph_id).length}"
|
|
133
|
+
|
|
134
|
+
colr.layers_for(glyph_id).each do |layer|
|
|
135
|
+
color = cpal.color(layer[:palette_index])
|
|
136
|
+
puts " Layer #{layer[:glyph_id]}: #{color}"
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
```
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SVG Color Fonts
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# SVG Color Fonts
|
|
6
|
+
|
|
7
|
+
SVG color fonts embed complete SVG documents for each glyph.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
SVG color fonts contain:
|
|
12
|
+
- Full SVG documents with shapes, gradients, effects
|
|
13
|
+
- Can be extremely detailed and complex
|
|
14
|
+
- Self-contained (no external resources)
|
|
15
|
+
|
|
16
|
+
## Structure
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
svg = font.tables['SVG']
|
|
20
|
+
|
|
21
|
+
# SVG documents by glyph ID
|
|
22
|
+
svg.documents.each do |glyph_id, doc|
|
|
23
|
+
puts "Glyph #{glyph_id}:"
|
|
24
|
+
puts doc # Complete SVG XML
|
|
25
|
+
end
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Reading SVG Fonts
|
|
29
|
+
|
|
30
|
+
### List SVG Glyphs
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
font = Fontisan::FontLoader.load('svg-font.ttf')
|
|
34
|
+
svg = font.tables['SVG']
|
|
35
|
+
|
|
36
|
+
if svg
|
|
37
|
+
svg.documents.each do |glyph_id, doc|
|
|
38
|
+
glyph_name = font.glyph_name(glyph_id)
|
|
39
|
+
puts "#{glyph_name}: #{doc.length} bytes"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Parse SVG Content
|
|
45
|
+
|
|
46
|
+
```ruby
|
|
47
|
+
require 'nokogiri'
|
|
48
|
+
|
|
49
|
+
svg = font.tables['SVG']
|
|
50
|
+
doc = svg.documents[42] # SVG for glyph 42
|
|
51
|
+
|
|
52
|
+
parsed = Nokogiri::XML(doc)
|
|
53
|
+
|
|
54
|
+
# Find elements
|
|
55
|
+
paths = parsed.css('path')
|
|
56
|
+
puts "Paths: #{paths.length}"
|
|
57
|
+
|
|
58
|
+
rects = parsed.css('rect')
|
|
59
|
+
puts "Rectangles: #{rects.length}"
|
|
60
|
+
|
|
61
|
+
# Find gradients
|
|
62
|
+
gradients = parsed.css('linearGradient', 'radialGradient')
|
|
63
|
+
puts "Gradients: #{gradients.length}"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## SVG Features
|
|
67
|
+
|
|
68
|
+
SVG fonts can include:
|
|
69
|
+
|
|
70
|
+
| Feature | Support |
|
|
71
|
+
|---------|---------|
|
|
72
|
+
| Paths | ✓ |
|
|
73
|
+
| Basic shapes | ✓ |
|
|
74
|
+
| Gradients | ✓ |
|
|
75
|
+
| Patterns | ✓ |
|
|
76
|
+
| Clip paths | ✓ |
|
|
77
|
+
| Masks | ✓ |
|
|
78
|
+
| Filters | Limited |
|
|
79
|
+
| Animations | No |
|
|
80
|
+
| Scripts | No |
|
|
81
|
+
|
|
82
|
+
## Exporting
|
|
83
|
+
|
|
84
|
+
### Export SVG Files
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
font = Fontisan::FontLoader.load('svg-font.ttf')
|
|
88
|
+
svg = font.tables['SVG']
|
|
89
|
+
|
|
90
|
+
Dir.mkdir('svg-glyphs') unless Dir.exist?('svg-glyphs')
|
|
91
|
+
|
|
92
|
+
svg.documents.each do |glyph_id, doc|
|
|
93
|
+
glyph_name = font.glyph_name(glyph_id) || "glyph-#{glyph_id}"
|
|
94
|
+
filename = "svg-glyphs/#{glyph_name}.svg"
|
|
95
|
+
File.write(filename, doc)
|
|
96
|
+
end
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Conversion
|
|
100
|
+
|
|
101
|
+
### SVG to Other Formats
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# SVG is preserved during conversion
|
|
105
|
+
fontisan convert svg-font.ttf --to otf --output svg-font.otf
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Remove SVG
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Create version without SVG
|
|
112
|
+
fontisan convert svg-font.ttf --to ttf --no-svg --output no-svg.ttf
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Limitations
|
|
116
|
+
|
|
117
|
+
### File Size
|
|
118
|
+
|
|
119
|
+
SVG fonts can be very large:
|
|
120
|
+
- XML text overhead
|
|
121
|
+
- Duplicate content across glyphs
|
|
122
|
+
- Embedded gradients and filters
|
|
123
|
+
|
|
124
|
+
### Browser Support
|
|
125
|
+
|
|
126
|
+
| Browser | Support |
|
|
127
|
+
|---------|---------|
|
|
128
|
+
| Firefox | Full |
|
|
129
|
+
| Safari | Full |
|
|
130
|
+
| Chrome | Full (since v98) |
|
|
131
|
+
| Edge | Full |
|
|
132
|
+
|
|
133
|
+
### Performance
|
|
134
|
+
|
|
135
|
+
- **Parsing** — SVG requires XML parsing
|
|
136
|
+
- **Rendering** — Complex effects are slow
|
|
137
|
+
- **Memory** — Large documents use more memory
|
|
138
|
+
|
|
139
|
+
## Comparison with COLR/CPAL
|
|
140
|
+
|
|
141
|
+
| Feature | SVG | COLR/CPAL |
|
|
142
|
+
|---------|-----|-----------|
|
|
143
|
+
| File size | Large | Small |
|
|
144
|
+
| Effects | Full | Limited |
|
|
145
|
+
| Gradients | Full | Limited |
|
|
146
|
+
| Browser support | Good | Good |
|
|
147
|
+
| Variable fonts | No | Yes |
|
|
148
|
+
|
|
149
|
+
## Best Practices
|
|
150
|
+
|
|
151
|
+
1. **Optimize SVGs** — Minimize file size
|
|
152
|
+
2. **Use COLR/CPAL if possible** — Better performance
|
|
153
|
+
3. **Test rendering** — Complex effects may not work everywhere
|
|
154
|
+
4. **Provide fallbacks** — Not all platforms support SVG fonts
|
data/docs/guide/color.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Color Fonts
|
|
2
|
+
|
|
3
|
+
Fontisan supports working with color fonts in various formats.
|
|
4
|
+
|
|
5
|
+
## Supported Formats
|
|
6
|
+
|
|
7
|
+
- **COLR/CPAL** - OpenType color font tables
|
|
8
|
+
- **SVG** - SVG-based color fonts
|
|
9
|
+
- **CBDT/CBLC** - Color bitmap fonts
|
|
10
|
+
|
|
11
|
+
## Reading Color Fonts
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'fontisan'
|
|
15
|
+
|
|
16
|
+
# Load a color font
|
|
17
|
+
font = Fontisan.load('color-font.ttf')
|
|
18
|
+
|
|
19
|
+
# Check if font has color
|
|
20
|
+
if font.color?
|
|
21
|
+
puts "This is a color font"
|
|
22
|
+
puts "Format: #{font.color_format}"
|
|
23
|
+
end
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Color Palettes
|
|
27
|
+
|
|
28
|
+
For COLR/CPAL fonts:
|
|
29
|
+
|
|
30
|
+
```ruby
|
|
31
|
+
# Get color palettes
|
|
32
|
+
palettes = font.color_palettes
|
|
33
|
+
|
|
34
|
+
palettes.each do |palette|
|
|
35
|
+
puts "Palette:"
|
|
36
|
+
palette.colors.each do |color|
|
|
37
|
+
puts " ##{color.hex}"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Converting Color Fonts
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
# Convert color font to WOFF2
|
|
46
|
+
Fontisan.convert('color-font.ttf', output_format: :woff2)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Related
|
|
50
|
+
|
|
51
|
+
- [Variable Fonts](/guide/variable) - Variable font support
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: vs Font-Validator
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Fontisan vs Font-Validator
|
|
6
|
+
|
|
7
|
+
Compare Fontisan with Microsoft's Font-Validator.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Font-Validator is Microsoft's C# tool for comprehensive font validation.
|
|
12
|
+
|
|
13
|
+
| | Font-Validator | Fontisan |
|
|
14
|
+
|---|----------------|----------|
|
|
15
|
+
| Language | C# | Ruby |
|
|
16
|
+
| Runtime | .NET required | None |
|
|
17
|
+
| Platform | Windows focus | Cross-platform |
|
|
18
|
+
| Features | Validation only | Full suite |
|
|
19
|
+
|
|
20
|
+
## Profile Equivalents
|
|
21
|
+
|
|
22
|
+
| Font-Validator | Fontisan |
|
|
23
|
+
|----------------|----------|
|
|
24
|
+
| Auto | `fontisan validate -t indexability` |
|
|
25
|
+
| Full | `fontisan validate -t production` |
|
|
26
|
+
| Web | `fontisan validate -t web` |
|
|
27
|
+
| Custom | `fontisan validate -t spec_compliance` |
|
|
28
|
+
|
|
29
|
+
## Feature Comparison
|
|
30
|
+
|
|
31
|
+
### Validation
|
|
32
|
+
|
|
33
|
+
| Feature | Font-Validator | Fontisan |
|
|
34
|
+
|---------|----------------|----------|
|
|
35
|
+
| Profiles | 3+ | 5 |
|
|
36
|
+
| Helpers | ~50 | 56 |
|
|
37
|
+
| Coverage reports | ✅ | ✅ |
|
|
38
|
+
| Custom rules | ❌ | ✅ |
|
|
39
|
+
| Severity levels | ✅ | ✅ |
|
|
40
|
+
| Output formats | XML | YAML, JSON, Text |
|
|
41
|
+
|
|
42
|
+
### Font Operations
|
|
43
|
+
|
|
44
|
+
| Feature | Font-Validator | Fontisan |
|
|
45
|
+
|---------|----------------|----------|
|
|
46
|
+
| Validation | ✅ | ✅ |
|
|
47
|
+
| Conversion | ❌ | ✅ |
|
|
48
|
+
| Subsetting | ❌ | ✅ |
|
|
49
|
+
| Information | Limited | ✅ |
|
|
50
|
+
| Collections | Limited | ✅ |
|
|
51
|
+
|
|
52
|
+
### Format Support
|
|
53
|
+
|
|
54
|
+
| Format | Font-Validator | Fontisan |
|
|
55
|
+
|--------|----------------|----------|
|
|
56
|
+
| TrueType | ✅ | ✅ |
|
|
57
|
+
| OpenType | ✅ | ✅ |
|
|
58
|
+
| WOFF | ✅ | ✅ |
|
|
59
|
+
| WOFF2 | ✅ | ✅ |
|
|
60
|
+
| Type 1 | ❌ | ✅ |
|
|
61
|
+
| TTC/OTC | Limited | ✅ |
|
|
62
|
+
|
|
63
|
+
### Variable Fonts
|
|
64
|
+
|
|
65
|
+
| Feature | Font-Validator | Fontisan |
|
|
66
|
+
|---------|----------------|----------|
|
|
67
|
+
| fvar validation | ✅ | ✅ |
|
|
68
|
+
| gvar validation | ✅ | ✅ |
|
|
69
|
+
| Instance generation | ❌ | ✅ |
|
|
70
|
+
| Format conversion | ❌ | ✅ |
|
|
71
|
+
|
|
72
|
+
## Validation Profiles
|
|
73
|
+
|
|
74
|
+
### Fontisan Profiles
|
|
75
|
+
|
|
76
|
+
| Profile | Checks | Focus |
|
|
77
|
+
|---------|--------|-------|
|
|
78
|
+
| indexability | 8 | Fast discovery |
|
|
79
|
+
| usability | 26 | Installation |
|
|
80
|
+
| production | 37 | Full quality |
|
|
81
|
+
| web | 18 | Web fonts |
|
|
82
|
+
| spec_compliance | Full | Spec audit |
|
|
83
|
+
|
|
84
|
+
### Font-Validator Profiles
|
|
85
|
+
|
|
86
|
+
| Profile | Focus |
|
|
87
|
+
|---------|-------|
|
|
88
|
+
| Auto | Quick check |
|
|
89
|
+
| Full | Comprehensive |
|
|
90
|
+
| Web | Web fonts |
|
|
91
|
+
|
|
92
|
+
## Unique Features
|
|
93
|
+
|
|
94
|
+
### Fontisan Unique
|
|
95
|
+
|
|
96
|
+
- **Pure Ruby** — No .NET runtime
|
|
97
|
+
- **Font conversion** — TTF ↔ OTF ↔ WOFF
|
|
98
|
+
- **Subsetting** — Create font subsets
|
|
99
|
+
- **Collections** — Full TTC/OTC support
|
|
100
|
+
- **Custom validators** — DSL for rules
|
|
101
|
+
- **Variable fonts** — Instance generation
|
|
102
|
+
- **Type 1 support** — Legacy format
|
|
103
|
+
|
|
104
|
+
### Font-Validator Unique
|
|
105
|
+
|
|
106
|
+
- **Microsoft official** — From the source
|
|
107
|
+
- **Deep Windows integration** — Windows-specific checks
|
|
108
|
+
- **Mature** — Long development history
|
|
109
|
+
|
|
110
|
+
## Installation Comparison
|
|
111
|
+
|
|
112
|
+
### Font-Validator
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Requires .NET runtime
|
|
116
|
+
# Windows: Download MSI
|
|
117
|
+
# Linux: Requires Mono or .NET Core
|
|
118
|
+
# macOS: Requires .NET Core
|
|
119
|
+
|
|
120
|
+
dotnet tool install --global FontValidator
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Fontisan
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# All platforms, no runtime
|
|
127
|
+
gem install fontisan
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Use Case Recommendations
|
|
131
|
+
|
|
132
|
+
### Use Fontisan When:
|
|
133
|
+
|
|
134
|
+
- You're not on Windows
|
|
135
|
+
- You need conversion features
|
|
136
|
+
- You need subsetting
|
|
137
|
+
- You want custom validators
|
|
138
|
+
- You need Type 1 support
|
|
139
|
+
|
|
140
|
+
### Use Font-Validator When:
|
|
141
|
+
|
|
142
|
+
- You need Microsoft official validation
|
|
143
|
+
- You need Windows-specific checks
|
|
144
|
+
- You're in a .NET environment
|
|
145
|
+
|
|
146
|
+
## Code Comparison
|
|
147
|
+
|
|
148
|
+
### Basic Validation
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Font-Validator
|
|
152
|
+
FontValidator.exe font.ttf
|
|
153
|
+
|
|
154
|
+
# Fontisan
|
|
155
|
+
fontisan validate font.ttf
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### With Profile
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Font-Validator
|
|
162
|
+
FontValidator.exe -Profile Full font.ttf
|
|
163
|
+
|
|
164
|
+
# Fontisan
|
|
165
|
+
fontisan validate font.ttf -t production
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Output Format
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Font-Validator
|
|
172
|
+
FontValidator.exe -Output report.xml font.ttf
|
|
173
|
+
|
|
174
|
+
# Fontisan
|
|
175
|
+
fontisan validate font.ttf --format json
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Custom Validators
|
|
179
|
+
|
|
180
|
+
Fontisan allows custom validation rules (not available in Font-Validator):
|
|
181
|
+
|
|
182
|
+
```ruby
|
|
183
|
+
class MyValidator < Fontisan::Validators::Validator
|
|
184
|
+
def define_checks
|
|
185
|
+
check_table :name_check, 'name', severity: :error do |table|
|
|
186
|
+
table.family_name_present? &&
|
|
187
|
+
table.postscript_name_valid?
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## CI/CD Integration
|
|
194
|
+
|
|
195
|
+
### Font-Validator
|
|
196
|
+
|
|
197
|
+
```yaml
|
|
198
|
+
# Requires .NET runtime
|
|
199
|
+
- uses: actions/setup-dotnet@v3
|
|
200
|
+
- run: FontValidator.exe fonts/*.ttf
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Fontisan
|
|
204
|
+
|
|
205
|
+
```yaml
|
|
206
|
+
# Uses Ruby (already available on most runners)
|
|
207
|
+
- uses: ruby/setup-ruby@v1
|
|
208
|
+
- run: gem install fontisan
|
|
209
|
+
- run: fontisan validate fonts/*.ttf
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Conclusion
|
|
213
|
+
|
|
214
|
+
| Need | Recommendation |
|
|
215
|
+
|------|----------------|
|
|
216
|
+
| Ruby environment | Fontisan |
|
|
217
|
+
| Cross-platform | Fontisan |
|
|
218
|
+
| Conversion features | Fontisan |
|
|
219
|
+
| Custom validation | Fontisan |
|
|
220
|
+
| Microsoft official | Font-Validator |
|
|
221
|
+
| Windows-specific | Font-Validator |
|
|
222
|
+
| .NET environment | Font-Validator |
|