fontisan 0.2.13 → 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 +56 -196
- data/Gemfile +1 -1
- 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/info_command.rb +5 -5
- data/lib/fontisan/commands/scripts_command.rb +0 -1
- data/lib/fontisan/converters/format_converter.rb +2 -1
- data/lib/fontisan/converters/type1_converter.rb +65 -60
- data/lib/fontisan/hints/hint_converter.rb +2 -1
- data/lib/fontisan/loading_modes.rb +0 -2
- data/lib/fontisan/open_type_font.rb +0 -40
- data/lib/fontisan/sfnt_font.rb +41 -22
- data/lib/fontisan/tables/glyf/compound_glyph.rb +0 -1
- data/lib/fontisan/true_type_collection.rb +8 -8
- data/lib/fontisan/true_type_font.rb +1 -59
- data/lib/fontisan/type1/afm_parser.rb +2 -1
- data/lib/fontisan/type1/cff_to_type1_converter.rb +24 -19
- data/lib/fontisan/type1/private_dict.rb +28 -7
- data/lib/fontisan/type1/seac_expander.rb +22 -17
- 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/woff2_font.rb +2 -2
- data/lib/fontisan/woff_font.rb +3 -3
- data/lib/fontisan.rb +3 -2
- metadata +122 -4
data/docs/index.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: home
|
|
3
|
+
pageClass: my-index-page
|
|
4
|
+
|
|
5
|
+
hero:
|
|
6
|
+
name: "Fontisan"
|
|
7
|
+
text: "Universal font processing library for Ruby"
|
|
8
|
+
tagline: The most comprehensive font library — 100% Pure Ruby, no Python, no C++, no C# dependencies.
|
|
9
|
+
actions:
|
|
10
|
+
- theme: brand
|
|
11
|
+
text: Get Started
|
|
12
|
+
link: /guide/
|
|
13
|
+
- theme: alt
|
|
14
|
+
text: View on GitHub
|
|
15
|
+
link: https://github.com/fontist/fontisan
|
|
16
|
+
- theme: alt
|
|
17
|
+
text: Migrate from fonttools
|
|
18
|
+
link: /guide/migrations/fonttools
|
|
19
|
+
|
|
20
|
+
features:
|
|
21
|
+
- title: "🔄 Font Conversion"
|
|
22
|
+
details: Convert between TTF, OTF, WOFF, WOFF2, Type 1 (PFB/PFA), and SVG formats with curve conversion and optimization.
|
|
23
|
+
- title: "✅ Font Validation"
|
|
24
|
+
details: Comprehensive validation with 5 profiles (OpenType, Google Fonts, Microsoft, Adobe, Production), 56 helpers, and custom DSL.
|
|
25
|
+
- title: "🎨 Color Fonts"
|
|
26
|
+
details: Full support for COLR/CPAL layered color fonts, sbix bitmap fonts, and SVG-based color fonts.
|
|
27
|
+
- title: "⚡ Variable Fonts"
|
|
28
|
+
details: Process OpenType variable fonts with instance generation, format conversion, and named instance support.
|
|
29
|
+
- title: "🔧 Font Hinting"
|
|
30
|
+
details: Bidirectional hint conversion between TrueType and PostScript formats — a unique Fontisan capability.
|
|
31
|
+
- title: "📦 Type 1 Support"
|
|
32
|
+
details: Adobe Type 1 fonts (PFB/PFA) with eexec decryption, CharString parsing, and conversion to modern formats.
|
|
33
|
+
- title: "📚 Collections"
|
|
34
|
+
details: TTC/OTC/dfont collection support with pack, unpack, table deduplication, and format conversion.
|
|
35
|
+
- title: "💎 Pure Ruby"
|
|
36
|
+
details: Zero external dependencies. No Python, no C++, no C# required. Works anywhere Ruby runs.
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
<WithinHero>
|
|
40
|
+
<HeroCodeBlock title="fontisan"><div class="line"><span class="comment"># Get detailed font information</span></div><div class="line"><span class="prompt">$</span> <span class="cmd">fontisan</span> info OpenSans-Regular.ttf</div><div class="line">Family: Open Sans Style: Regular Format: TTF</div><div class="line"><span class="comment"># Convert between formats</span></div><div class="line"><span class="prompt">$</span> <span class="cmd">fontisan</span> convert font.ttf --to woff2</div><div class="line"><span class="success">✓</span> font.woff2 created (45% smaller)</div><div class="line"><span class="comment"># Validate with Google Fonts profile</span></div><div class="line"><span class="prompt">$</span> <span class="cmd">fontisan</span> validate font.ttf -p google_fonts</div><div class="line"><span class="success">✓</span> All 56 checks passed</div></HeroCodeBlock>
|
|
41
|
+
</WithinHero>
|
|
42
|
+
|
|
43
|
+
<style>
|
|
44
|
+
.pure-ruby-hero {
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 0.5rem;
|
|
48
|
+
padding: 0.25rem 0.75rem;
|
|
49
|
+
background: linear-gradient(135deg, #bf4e6a, #d4718a);
|
|
50
|
+
color: white;
|
|
51
|
+
border-radius: 9999px;
|
|
52
|
+
font-size: 0.85rem;
|
|
53
|
+
font-weight: 700;
|
|
54
|
+
text-transform: uppercase;
|
|
55
|
+
letter-spacing: 0.05em;
|
|
56
|
+
margin-top: 1rem;
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
59
|
+
|
|
60
|
+
<div class="pure-ruby-hero">
|
|
61
|
+
💎 100% Pure Ruby
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
## Why Fontisan?
|
|
65
|
+
|
|
66
|
+
Fontisan is the **most comprehensive font processing library in pure Ruby**, combining the capabilities of:
|
|
67
|
+
|
|
68
|
+
- **fonttools** (Python) — 100+ OpenType tables, variable fonts, subsetting
|
|
69
|
+
- **lcdf-typetools** (C++) — otfinfo, cfftot1, Type 1 validation
|
|
70
|
+
- **Font-Validator** (C#) — Comprehensive validation with coverage reports
|
|
71
|
+
|
|
72
|
+
**The key differentiator**: Fontisan is 100% pure Ruby. No Python, no C++, no C# dependencies. Install and run anywhere Ruby runs.
|
|
73
|
+
|
|
74
|
+
## Feature Comparison
|
|
75
|
+
|
|
76
|
+
| Feature | fonttools | lcdf-typetools | Font-Validator | **Fontisan** |
|
|
77
|
+
|---------|-----------|----------------|----------------|--------------|
|
|
78
|
+
| Pure Ruby | ❌ | ❌ | ❌ | ✅ |
|
|
79
|
+
| Python-free | ❌ | ✅ | ✅ | ✅ |
|
|
80
|
+
| Font conversion | ✅ | ✅ | ❌ | ✅ |
|
|
81
|
+
| Validation | ❌ | ❌ | ✅ | ✅ |
|
|
82
|
+
| Bidirectional hints | ❌ | Partial | ❌ | ✅ |
|
|
83
|
+
| Variable fonts | ✅ | ❌ | ❌ | ✅ |
|
|
84
|
+
| Type 1 support | Partial | ✅ | ❌ | ✅ |
|
|
85
|
+
|
|
86
|
+
[See full comparison →](/guide/comparisons/)
|
|
87
|
+
|
|
88
|
+
## CLI Usage
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Get font information
|
|
92
|
+
fontisan info font.ttf
|
|
93
|
+
|
|
94
|
+
# Convert fonts
|
|
95
|
+
fontisan convert input.ttf --to otf --output output.otf
|
|
96
|
+
|
|
97
|
+
# Validate fonts
|
|
98
|
+
fontisan validate font.ttf --profile google_fonts
|
|
99
|
+
|
|
100
|
+
# Work with collections
|
|
101
|
+
fontisan unpack fonts.ttc --output-dir ./extracted
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Ruby API
|
|
105
|
+
|
|
106
|
+
```ruby
|
|
107
|
+
require 'fontisan'
|
|
108
|
+
|
|
109
|
+
# Load any font format
|
|
110
|
+
font = Fontisan::FontLoader.load('font.ttf')
|
|
111
|
+
|
|
112
|
+
# Get font information
|
|
113
|
+
info = Fontisan::Commands::InfoCommand.new(font: font).run
|
|
114
|
+
puts info.family_name
|
|
115
|
+
puts info.style
|
|
116
|
+
|
|
117
|
+
# Convert between formats
|
|
118
|
+
Fontisan::FontWriter.write(font, 'output.woff2')
|
|
119
|
+
|
|
120
|
+
# Validate a font
|
|
121
|
+
result = Fontisan::FontValidator.validate('font.otf', profile: :google_fonts)
|
|
122
|
+
puts result.passed?
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Migration Guides
|
|
126
|
+
|
|
127
|
+
Coming from another tool? We have migration guides:
|
|
128
|
+
|
|
129
|
+
- [From fonttools (Python)](/guide/migrations/fonttools) — Comprehensive Python to Ruby migration
|
|
130
|
+
- [From extract_ttc](/guide/migrations/extract-ttc) — Already fully compatible
|
|
131
|
+
- [From otfinfo](/guide/migrations/otfinfo) — Command equivalents for lcdf-typetools
|
|
132
|
+
- [From Font-Validator](/guide/migrations/font-validator) — Validation profile mapping
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
Fontisan is open source and available under the [MIT License](https://github.com/fontist/fontisan/blob/main/LICENSE).
|
data/docs/lychee.toml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Lychee Link Checker Configuration
|
|
2
|
+
# https://github.com/lycheeverse/lychee
|
|
3
|
+
|
|
4
|
+
############################# Cache ###############################
|
|
5
|
+
cache = true
|
|
6
|
+
max_cache_age = "1d"
|
|
7
|
+
|
|
8
|
+
############################# Runtime #############################
|
|
9
|
+
max_redirects = 10
|
|
10
|
+
max_retries = 3
|
|
11
|
+
max_concurrency = 8
|
|
12
|
+
timeout = 20
|
|
13
|
+
|
|
14
|
+
############################# Requests ############################
|
|
15
|
+
accept = ["200..=299", "429"]
|
|
16
|
+
user_agent = "lychee/fontisan-docs"
|
|
17
|
+
scheme = ["https", "http", "file"]
|
|
18
|
+
require_https = false
|
|
19
|
+
include_mail = false
|
|
20
|
+
include_verbatim = true
|
|
21
|
+
|
|
22
|
+
############################# Exclusions ##########################
|
|
23
|
+
# Exclude URLs (regex patterns)
|
|
24
|
+
exclude = [
|
|
25
|
+
'github\.com/fontist/fontisan/issues',
|
|
26
|
+
'github\.com/fontist/extract_ttc',
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
# Exclude paths from checking (regex patterns)
|
|
30
|
+
exclude_path = [
|
|
31
|
+
"node_modules",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
############################# Other ###############################
|
|
35
|
+
verbose = "info"
|
|
36
|
+
index_files = ["index.html"]
|
|
37
|
+
fallback_extensions = ["html"]
|