fontisan 0.4.53 → 0.4.55

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +17 -1
  3. data/TODO.bug-fixes/README.md +1 -1
  4. data/docs/.gitignore +4 -0
  5. data/docs/astro.config.mjs +16 -0
  6. data/docs/package-lock.json +4031 -1506
  7. data/docs/package.json +12 -5
  8. data/docs/scripts/sitemap-base.mjs +81 -0
  9. data/docs/src/content.config.ts +32 -0
  10. data/docs/{.vitepress/config.ts → src/data/sidebar.ts} +235 -146
  11. data/docs/src/layouts/Site.astro +320 -0
  12. data/docs/src/pages/404.astro +14 -0
  13. data/docs/src/pages/api/[...slug].astro +22 -0
  14. data/docs/src/pages/api/index.astro +12 -0
  15. data/docs/src/pages/cli/[...slug].astro +22 -0
  16. data/docs/src/pages/cli/index.astro +12 -0
  17. data/docs/src/pages/guide/[...slug].astro +22 -0
  18. data/docs/src/pages/guide/index.astro +12 -0
  19. data/docs/src/pages/history/[...slug].astro +22 -0
  20. data/docs/src/pages/history/index.astro +24 -0
  21. data/docs/src/pages/index.astro +234 -0
  22. data/docs/src/pages/root/[...slug].astro +20 -0
  23. data/docs/src/styles/site.css +88 -0
  24. data/ext/fontisan_cdylib/Cargo.lock +17 -1
  25. data/ext/fontisan_cdylib/Cargo.toml +1 -1
  26. data/ext/fontisan_native/Cargo.toml +1 -1
  27. data/lib/fontisan/byte_ops.rb +2 -2
  28. data/lib/fontisan/converters/collection_converter.rb +4 -0
  29. data/lib/fontisan/engine.rb +14 -12
  30. data/lib/fontisan/native.rb +1 -1
  31. data/lib/fontisan/version.rb +1 -1
  32. data/lib/fontisan/woff2/glyf_loca_reconstruct.rb +4 -0
  33. metadata +18 -10
  34. data/docs/.vitepress/theme/components/ApiMethod.vue +0 -127
  35. data/docs/.vitepress/theme/components/Badge.vue +0 -51
  36. data/docs/.vitepress/theme/components/FeatureComparison.vue +0 -87
  37. data/docs/.vitepress/theme/components/HeroCodeBlock.vue +0 -98
  38. data/docs/.vitepress/theme/components/WithinHero.vue +0 -30
  39. data/docs/.vitepress/theme/index.ts +0 -22
  40. data/docs/.vitepress/theme/style.css +0 -628
  41. data/docs/scripts/post-build.mjs +0 -81
@@ -0,0 +1,234 @@
1
+ ---
2
+ import Site from "../layouts/Site.astro";
3
+
4
+ const base = import.meta.env.BASE_URL.replace(/\/$/, "");
5
+
6
+ const features = [
7
+ { title: "🔄 Font Conversion", details: "Convert between TTF, OTF, WOFF, WOFF2, Type 1 (PFB/PFA), and SVG formats with curve conversion and optimization." },
8
+ { title: "✅ Font Validation", details: "Comprehensive validation with 5 profiles (OpenType, Google Fonts, Microsoft, Adobe, Production), 56 helpers, and custom DSL." },
9
+ { title: "🎨 Color Fonts", details: "Full support for COLR/CPAL layered color fonts, sbix bitmap fonts, and SVG-based color fonts." },
10
+ { title: "⚡ Variable Fonts", details: "Process OpenType variable fonts with instance generation, format conversion, and named instance support." },
11
+ { title: "🔧 Font Hinting", details: "Bidirectional hint conversion between TrueType and PostScript formats — a unique Fontisan capability." },
12
+ { title: "📦 Type 1 Support", details: "Adobe Type 1 fonts (PFB/PFA) with eexec decryption, CharString parsing, and conversion to modern formats." },
13
+ { title: "📚 Collections", details: "TTC/OTC/dfont collection support with pack, unpack, table deduplication, and format conversion." },
14
+ { title: "💎 Pure Ruby", details: "Zero external dependencies. No Python, no C++, no C# required. Works anywhere Ruby runs." },
15
+ ];
16
+ ---
17
+ <Site title="Fontisan — Universal font processing library for Ruby" description="The most comprehensive font processing library for Ruby — 100% Pure Ruby, no Python, no C++, no C# dependencies.">
18
+ <section class="fontisan-hero">
19
+ <div class="pure-ruby-hero">💎 100% Pure Ruby</div>
20
+ <h1 class="hero-name">Fontisan</h1>
21
+ <p class="hero-text">Universal font processing library for Ruby</p>
22
+ <p class="hero-tagline">The most comprehensive font library — 100% Pure Ruby, no Python, no C++, no C# dependencies.</p>
23
+ <div class="hero-actions">
24
+ <a class="action brand" href={`${base}/guide/`}>Get Started</a>
25
+ <a class="action alt" href="https://github.com/fontist/fontisan">View on GitHub</a>
26
+ <a class="action alt" href={`${base}/guide/migrations/fonttools`}>Migrate from fonttools</a>
27
+ </div>
28
+ <div class="hero-terminal">
29
+ <div class="term-title">fontisan</div>
30
+ <div class="term-body">
31
+ <div class="line"><span class="comment"># Get detailed font information</span></div>
32
+ <div class="line"><span class="prompt">$</span> <span class="cmd">fontisan</span> info OpenSans-Regular.ttf</div>
33
+ <div class="line">Family: Open Sans Style: Regular Format: TTF</div>
34
+ <div class="line"><span class="comment"># Convert between formats</span></div>
35
+ <div class="line"><span class="prompt">$</span> <span class="cmd">fontisan</span> convert font.ttf --to woff2</div>
36
+ <div class="line"><span class="success">✓</span> font.woff2 created (45% smaller)</div>
37
+ <div class="line"><span class="comment"># Validate with Google Fonts profile</span></div>
38
+ <div class="line"><span class="prompt">$</span> <span class="cmd">fontisan</span> validate font.ttf -p google_fonts</div>
39
+ <div class="line"><span class="success">✓</span> All 56 checks passed</div>
40
+ </div>
41
+ </div>
42
+ </section>
43
+
44
+ <section class="features-grid">
45
+ {features.map((f) => (
46
+ <div class="feature-card">
47
+ <div class="feature-title">{f.title}</div>
48
+ <div class="feature-details">{f.details}</div>
49
+ </div>
50
+ ))}
51
+ </section>
52
+
53
+ <article class="prose home-prose">
54
+ <h2>Why Fontisan?</h2>
55
+ <p>
56
+ Fontisan is the <strong>most comprehensive font processing library in pure Ruby</strong>, combining the
57
+ capabilities of:
58
+ </p>
59
+ <ul>
60
+ <li><strong>fonttools</strong> (Python) — 100+ OpenType tables, variable fonts, subsetting</li>
61
+ <li><strong>lcdf-typetools</strong> (C++) — otfinfo, cfftot1, Type 1 validation</li>
62
+ <li><strong>Font-Validator</strong> (C#) — Comprehensive validation with coverage reports</li>
63
+ </ul>
64
+ <p>
65
+ <strong>The key differentiator</strong>: Fontisan is 100% pure Ruby. No Python, no C++, no C# dependencies.
66
+ Install and run anywhere Ruby runs.
67
+ </p>
68
+
69
+ <h2>Feature Comparison</h2>
70
+ <table>
71
+ <thead>
72
+ <tr><th>Feature</th><th>fonttools</th><th>lcdf-typetools</th><th>Font-Validator</th><th><strong>Fontisan</strong></th></tr>
73
+ </thead>
74
+ <tbody>
75
+ <tr><td>Pure Ruby</td><td>❌</td><td>❌</td><td>❌</td><td>✅</td></tr>
76
+ <tr><td>Python-free</td><td>❌</td><td>✅</td><td>✅</td><td>✅</td></tr>
77
+ <tr><td>Font conversion</td><td>✅</td><td>✅</td><td>❌</td><td>✅</td></tr>
78
+ <tr><td>Validation</td><td>❌</td><td>❌</td><td>✅</td><td>✅</td></tr>
79
+ <tr><td>Bidirectional hints</td><td>❌</td><td>Partial</td><td>❌</td><td>✅</td></tr>
80
+ <tr><td>Variable fonts</td><td>✅</td><td>❌</td><td>❌</td><td>✅</td></tr>
81
+ <tr><td>Type 1 support</td><td>Partial</td><td>✅</td><td>❌</td><td>✅</td></tr>
82
+ </tbody>
83
+ </table>
84
+ <p><a href={`${base}/guide/comparisons/`}>See full comparison →</a></p>
85
+
86
+ <h2>CLI Usage</h2>
87
+ <pre><code>{`# Get font information
88
+ fontisan info font.ttf
89
+
90
+ # Convert fonts
91
+ fontisan convert input.ttf --to otf --output output.otf
92
+
93
+ # Validate fonts
94
+ fontisan validate font.ttf --profile google_fonts
95
+
96
+ # Work with collections
97
+ fontisan unpack fonts.ttc --output-dir ./extracted`}</code></pre>
98
+ </article>
99
+ </Site>
100
+
101
+ <style>
102
+ .fontisan-hero {
103
+ text-align: center;
104
+ padding: 3.5rem 1.5rem 2rem;
105
+ }
106
+ .hero-name {
107
+ font-family: var(--spec-font-display);
108
+ font-size: 3.5rem;
109
+ font-weight: 700;
110
+ letter-spacing: -0.03em;
111
+ margin: 1rem 0 0.25rem;
112
+ background: linear-gradient(120deg, var(--fontist-rose) 30%, var(--fontist-rose-light));
113
+ -webkit-background-clip: text;
114
+ background-clip: text;
115
+ color: transparent;
116
+ }
117
+ .hero-text {
118
+ font-size: 1.35rem;
119
+ font-weight: 600;
120
+ color: var(--vp-c-text-1);
121
+ margin: 0;
122
+ }
123
+ .hero-tagline {
124
+ color: var(--vp-c-text-2);
125
+ margin: 0.5rem auto 1.25rem;
126
+ max-width: 620px;
127
+ }
128
+ .pure-ruby-hero {
129
+ display: inline-flex;
130
+ align-items: center;
131
+ gap: 0.5rem;
132
+ padding: 0.25rem 0.75rem;
133
+ background: linear-gradient(135deg, #bf4e6a, #d4718a);
134
+ color: white;
135
+ border-radius: 9999px;
136
+ font-size: 0.85rem;
137
+ font-weight: 700;
138
+ text-transform: uppercase;
139
+ letter-spacing: 0.05em;
140
+ margin-top: 0.5rem;
141
+ }
142
+ .hero-actions {
143
+ display: flex;
144
+ justify-content: center;
145
+ gap: 0.75rem;
146
+ margin-bottom: 2rem;
147
+ flex-wrap: wrap;
148
+ }
149
+ .action {
150
+ padding: 0.6rem 1.4rem;
151
+ border-radius: 10px;
152
+ font-weight: 500;
153
+ text-decoration: none;
154
+ font-size: 0.95rem;
155
+ }
156
+ .action.brand {
157
+ background: var(--spec-rose);
158
+ color: #fff;
159
+ }
160
+ .action.brand:hover {
161
+ background: #a3435a;
162
+ color: #fff;
163
+ }
164
+ .action.alt {
165
+ border: 1px solid var(--spec-rule-strong);
166
+ color: var(--vp-c-text-1);
167
+ }
168
+ .action.alt:hover {
169
+ border-color: var(--spec-rose);
170
+ color: var(--spec-rose);
171
+ }
172
+ .hero-terminal {
173
+ max-width: 640px;
174
+ margin: 0 auto;
175
+ text-align: left;
176
+ border-radius: 12px;
177
+ overflow: hidden;
178
+ border: 1px solid var(--spec-rule);
179
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
180
+ }
181
+ .term-title {
182
+ background: var(--spec-term-bg);
183
+ color: var(--spec-term-ink);
184
+ font-family: var(--vp-font-family-mono);
185
+ font-size: 0.8rem;
186
+ padding: 0.5rem 1rem;
187
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
188
+ }
189
+ .term-body {
190
+ background: var(--spec-term-bg);
191
+ color: var(--spec-term-ink);
192
+ font-family: var(--vp-font-family-mono);
193
+ font-size: 0.85rem;
194
+ line-height: 1.7;
195
+ padding: 1rem 1.25rem;
196
+ }
197
+ .term-body .comment { color: #8f887e; }
198
+ .term-body .prompt { color: var(--spec-rose-soft); }
199
+ .term-body .cmd { color: #ecdfd0; font-weight: 500; }
200
+ .term-body .success { color: #7fbf7f; }
201
+ .features-grid {
202
+ display: grid;
203
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
204
+ gap: 1rem;
205
+ max-width: 1080px;
206
+ margin: 1rem auto 2rem;
207
+ padding: 0 1.5rem;
208
+ }
209
+ .feature-card {
210
+ border: 1px solid var(--spec-rule);
211
+ border-radius: 12px;
212
+ padding: 1.25rem;
213
+ background: var(--vp-c-bg-soft);
214
+ transition: border-color 0.2s;
215
+ }
216
+ .feature-card:hover {
217
+ border-color: var(--spec-rose);
218
+ }
219
+ .feature-title {
220
+ font-weight: 600;
221
+ color: var(--vp-c-text-1);
222
+ margin-bottom: 0.4rem;
223
+ }
224
+ .feature-details {
225
+ font-size: 0.875rem;
226
+ color: var(--vp-c-text-2);
227
+ line-height: 1.6;
228
+ }
229
+ .home-prose {
230
+ max-width: 860px;
231
+ margin: 0 auto;
232
+ padding: 0 1.5rem 2rem;
233
+ }
234
+ </style>
@@ -0,0 +1,20 @@
1
+ ---
2
+ import Site from "../../layouts/Site.astro";
3
+ import { getCollection, render } from "astro:content";
4
+
5
+ export async function getStaticPaths() {
6
+ const entries = await getCollection("rootPages");
7
+ return entries.map((entry) => ({
8
+ params: { slug: entry.id },
9
+ props: { entry },
10
+ }));
11
+ }
12
+
13
+ const { entry } = Astro.props;
14
+ const { Content } = await render(entry);
15
+ ---
16
+ <Site title={entry.data?.title ?? entry.id} description={entry.data?.description}>
17
+ <article class="prose doc-page">
18
+ <Content />
19
+ </article>
20
+ </Site>
@@ -0,0 +1,88 @@
1
+ @import "tailwindcss";
2
+
3
+ /* Fontisan docs site — Astro 7 + Tailwind 4.
4
+ Palette ported from the specimen design system in the VitePress theme.
5
+ The --vp-c-* variables stay as aliases so ported CSS applies unchanged. */
6
+ :root {
7
+ --fontist-rose: #bf4e6a;
8
+ --fontist-rose-light: #d4718a;
9
+ --fontist-dark: #4d4b54;
10
+ --fontist-gray: #676565;
11
+ --fontist-cream: #e1dfd2;
12
+ --fontist-beige: #bebbac;
13
+ --fontist-pale: #dddac8;
14
+
15
+ --spec-paper: #f1ece1;
16
+ --spec-paper-deep: #e7e0d1;
17
+ --spec-ink: #1c1a18;
18
+ --spec-ink-soft: #4a4744;
19
+ --spec-mute: #75716c;
20
+ --spec-rose: #b8475f;
21
+ --spec-rose-soft: #d4718a;
22
+ --spec-rule: rgba(28, 26, 24, 0.16);
23
+ --spec-rule-strong: rgba(28, 26, 24, 0.5);
24
+ --spec-term-bg: #1c1a18;
25
+ --spec-term-ink: #ecdfd0;
26
+
27
+ --vp-c-brand-1: var(--spec-rose);
28
+ --vp-c-brand-2: #a3435a;
29
+ --vp-c-brand-3: var(--spec-ink);
30
+ --vp-c-brand-soft: rgba(184, 71, 95, 0.12);
31
+ --vp-c-text-1: var(--spec-ink);
32
+ --vp-c-text-2: var(--spec-ink-soft);
33
+ --vp-c-text-3: var(--spec-mute);
34
+ --vp-c-bg: var(--spec-paper);
35
+ --vp-c-bg-soft: var(--spec-paper-deep);
36
+ --vp-c-divider: var(--spec-rule);
37
+ --vp-font-family-mono: "IBM Plex Mono", ui-monospace, monospace;
38
+ --spec-font-display: "Spectral", Georgia, serif;
39
+ --spec-font-body: "IBM Plex Sans", system-ui, sans-serif;
40
+ }
41
+
42
+ html.dark {
43
+ --spec-paper: #211e1c;
44
+ --spec-paper-deep: #2a2623;
45
+ --spec-ink: #ecdfd0;
46
+ --spec-ink-soft: #c9bda9;
47
+ --spec-mute: #8f887e;
48
+ --spec-rose: #d4718a;
49
+ --spec-rule: rgba(236, 223, 208, 0.16);
50
+ --spec-term-bg: #0d0c0c;
51
+ --vp-c-bg: var(--spec-paper);
52
+ --vp-c-bg-soft: var(--spec-paper-deep);
53
+ }
54
+
55
+ @theme {
56
+ --color-rose: var(--fontist-rose);
57
+ --color-rose-light: var(--fontist-rose-light);
58
+ --color-paper: var(--spec-paper);
59
+ --color-paper-deep: var(--spec-paper-deep);
60
+ --color-ink: var(--spec-ink);
61
+ --color-ink-soft: var(--spec-ink-soft);
62
+ --color-mute: var(--spec-mute);
63
+ --font-display: "Spectral", Georgia, serif;
64
+ --font-body: "IBM Plex Sans", system-ui, sans-serif;
65
+ }
66
+
67
+ body {
68
+ background: var(--vp-c-bg);
69
+ color: var(--vp-c-text-1);
70
+ font-family: var(--spec-font-body);
71
+ }
72
+
73
+ /* Markdown content (prose) */
74
+ .prose h1 { font-family: var(--spec-font-display); font-size: 2.1rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 1rem; color: var(--vp-c-text-1); }
75
+ .prose h2 { font-family: var(--spec-font-display); font-size: 1.5rem; font-weight: 600; margin: 2rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--spec-rule); color: var(--vp-c-text-1); }
76
+ .prose h3 { font-family: var(--spec-font-display); font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--vp-c-text-1); }
77
+ .prose p, .prose li { line-height: 1.7; color: var(--vp-c-text-1); }
78
+ .prose a { color: var(--spec-rose); }
79
+ .prose a:hover { color: #a3435a; }
80
+ .prose code { font-family: var(--vp-font-family-mono); font-size: 0.875em; background: var(--vp-c-bg-soft); padding: 0.15em 0.4em; border-radius: 6px; }
81
+ .prose pre { background: var(--spec-term-bg); color: var(--spec-term-ink); padding: 1rem 1.25rem; border-radius: 10px; overflow-x: auto; margin: 1rem 0; }
82
+ .prose pre code { background: none; padding: 0; color: inherit; }
83
+ .prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
84
+ .prose th, .prose td { border: 1px solid var(--spec-rule); padding: 0.5rem 0.75rem; text-align: left; }
85
+ .prose th { background: var(--vp-c-bg-soft); }
86
+ .prose blockquote { border-left: 3px solid var(--spec-rose); padding-left: 1rem; color: var(--vp-c-text-2); margin: 1rem 0; }
87
+ .prose img { max-width: 100%; }
88
+ .prose hr { border-color: var(--spec-rule); margin: 2rem 0; }
@@ -108,6 +108,15 @@ dependencies = [
108
108
  "crypto-common",
109
109
  ]
110
110
 
111
+ [[package]]
112
+ name = "flate2"
113
+ version = "1.1.11"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4"
116
+ dependencies = [
117
+ "zlib-rs",
118
+ ]
119
+
111
120
  [[package]]
112
121
  name = "foldhash"
113
122
  version = "0.2.0"
@@ -126,10 +135,11 @@ dependencies = [
126
135
  [[package]]
127
136
  name = "fontisan"
128
137
  version = "0.0.0"
129
- source = "git+https://github.com/fontist/fontisan-rs?rev=eedd92987b6d08a62b3451a7c03757d0340ebc79#eedd92987b6d08a62b3451a7c03757d0340ebc79"
138
+ source = "git+https://github.com/fontist/fontisan-rs?rev=89c64de798794e271e289a3f51ec394eb7db3fee#89c64de798794e271e289a3f51ec394eb7db3fee"
130
139
  dependencies = [
131
140
  "brotli",
132
141
  "brotli-decompressor",
142
+ "flate2",
133
143
  "miniz_oxide",
134
144
  "read-fonts",
135
145
  "sha2",
@@ -311,3 +321,9 @@ dependencies = [
311
321
  "syn",
312
322
  "synstructure",
313
323
  ]
324
+
325
+ [[package]]
326
+ name = "zlib-rs"
327
+ version = "0.6.9"
328
+ source = "registry+https://github.com/rust-lang/crates.io-index"
329
+ checksum = "aa76918995d776d9dd34d371030be228d021137449771493d56e29f77e4148ac"
@@ -15,4 +15,4 @@ crate-type = ["cdylib"]
15
15
  [dependencies]
16
16
  # TEMPORARY (decision D3: the crate is not on crates.io yet). Replace with
17
17
  # `fontisan = { version = "=<release>", features = ["ffi"] }` once published.
18
- fontisan = { git = "https://github.com/fontist/fontisan-rs", rev = "eedd92987b6d08a62b3451a7c03757d0340ebc79", features = ["ffi"] }
18
+ fontisan = { git = "https://github.com/fontist/fontisan-rs", rev = "89c64de798794e271e289a3f51ec394eb7db3fee", features = ["ffi"] }
@@ -13,7 +13,7 @@ crate-type = ["cdylib"]
13
13
  # TEMPORARY (decision D3: the crate is not on crates.io yet). Replace with
14
14
  # `fontisan = "=<version>"` once published. The rev must be a commit on
15
15
  # fontist/fontisan-rs; keep it equal to the rev in ext/fontisan_cdylib/Cargo.toml.
16
- fontisan = { git = "https://github.com/fontist/fontisan-rs", rev = "eedd92987b6d08a62b3451a7c03757d0340ebc79" }
16
+ fontisan = { git = "https://github.com/fontist/fontisan-rs", rev = "89c64de798794e271e289a3f51ec394eb7db3fee" }
17
17
  magnus = "=0.9.4"
18
18
  rb-sys = { version = "=0.9.130", default-features = false }
19
19
 
@@ -8,8 +8,8 @@ module Fontisan
8
8
  module ByteOps
9
9
  # Convert target codes of the engine (extension and C ABI alike).
10
10
  TARGET_CODES = { ttf: 0, otf: 1, woff: 2, woff2: 3, ttc: 4, otc: 5,
11
- svg: 6 }.freeze
12
- SINGLE_TARGETS = %i[ttf otf woff woff2 svg].freeze
11
+ svg: 6, type1: 7 }.freeze
12
+ SINGLE_TARGETS = %i[ttf otf woff woff2 svg type1].freeze
13
13
  COLLECTION_TARGETS = %i[ttc otc woff2].freeze
14
14
  # The caller's `.ttc`/`.otc` extension decision for a `ttcf` input
15
15
  # (#192 gap 7): the engine's bytes carry no path.
@@ -515,6 +515,10 @@ conversions)
515
515
 
516
516
  options[:options] if options.is_a?(Hash)
517
517
  end
518
+
519
+ # Format detection drives member conversion policy and is tested
520
+ # directly (TODO 30).
521
+ public :detect_font_format
518
522
  end
519
523
  end
520
524
  end
@@ -216,6 +216,20 @@ module Fontisan
216
216
  end
217
217
  end
218
218
 
219
+ # Current configuration from the environment; raises for a bad value.
220
+ # Public: the strict-mode contract is load-bearing and tested directly.
221
+ def config_from_env
222
+ selection = ENV.fetch("FONTISAN_ENGINE", "auto").strip.downcase
223
+ selection = "auto" if selection.empty?
224
+ unless SELECTIONS.include?(selection)
225
+ raise ConfigError,
226
+ "FONTISAN_ENGINE=#{selection.inspect} is not one of " \
227
+ "#{SELECTIONS.join(', ')}"
228
+ end
229
+
230
+ Config.new(selection.to_sym, strict_from_env)
231
+ end
232
+
219
233
  private
220
234
 
221
235
  def validate_registration!(name, tier)
@@ -232,18 +246,6 @@ module Fontisan
232
246
  "tier #{name} does not implement #{missing.join(', ')}"
233
247
  end
234
248
 
235
- def config_from_env
236
- selection = ENV.fetch("FONTISAN_ENGINE", "auto").strip.downcase
237
- selection = "auto" if selection.empty?
238
- unless SELECTIONS.include?(selection)
239
- raise ConfigError,
240
- "FONTISAN_ENGINE=#{selection.inspect} is not one of " \
241
- "#{SELECTIONS.join(', ')}"
242
- end
243
-
244
- Config.new(selection.to_sym, strict_from_env)
245
- end
246
-
247
249
  # 1/true/yes/on is strict; unset, empty and 0/false/no/off is not. Any
248
250
  # other value raises, as an unknown FONTISAN_ENGINE does: a typo must not
249
251
  # silently leave a service non-strict.
@@ -26,7 +26,7 @@ module Fontisan
26
26
  # engine pin in ext/*/Cargo.toml, which each build embeds. ABI_VERSION does
27
27
  # not move on a repin, so this is what keeps a stale binary from serving old
28
28
  # behaviour. A repin seds it with the Cargo files (repin-push162.sh).
29
- ENGINE_REV = "eedd92987b6d08a62b3451a7c03757d0340ebc79"
29
+ ENGINE_REV = "89c64de798794e271e289a3f51ec394eb7db3fee"
30
30
 
31
31
  # Operations served natively. Convert, extract, instance and subset are
32
32
  # path-based only (card 2f): the object-based entry points
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fontisan
4
- VERSION = "0.4.53"
4
+ VERSION = "0.4.55"
5
5
  end
@@ -396,6 +396,10 @@ module Fontisan
396
396
  offsets.pack("N*")
397
397
  end
398
398
  end
399
+
400
+ # RLE flag encoding is a pure transformation with boundary cases
401
+ # exercised directly (TODO 30).
402
+ public :encode_flags_rle
399
403
  end
400
404
  end
401
405
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontisan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.53
4
+ version: 0.4.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -208,14 +208,6 @@ files:
208
208
  - benchmark/tier_baseline.json
209
209
  - benchmark/variation_quick_bench.rb
210
210
  - docs/.gitignore
211
- - docs/.vitepress/config.ts
212
- - docs/.vitepress/theme/components/ApiMethod.vue
213
- - docs/.vitepress/theme/components/Badge.vue
214
- - docs/.vitepress/theme/components/FeatureComparison.vue
215
- - docs/.vitepress/theme/components/HeroCodeBlock.vue
216
- - docs/.vitepress/theme/components/WithinHero.vue
217
- - docs/.vitepress/theme/index.ts
218
- - docs/.vitepress/theme/style.css
219
211
  - docs/AFDKO_MIGRATION.adoc
220
212
  - docs/APPLE_LEGACY_FONTS.adoc
221
213
  - docs/CFF2_SUPPORT.adoc
@@ -249,6 +241,7 @@ files:
249
241
  - docs/api/validators/font-validator.md
250
242
  - docs/api/validators/helper.md
251
243
  - docs/api/validators/profile.md
244
+ - docs/astro.config.mjs
252
245
  - docs/cli/convert.md
253
246
  - docs/cli/dump-table.md
254
247
  - docs/cli/export.md
@@ -347,7 +340,22 @@ files:
347
340
  - docs/public/web-app-manifest-192x192.png
348
341
  - docs/public/web-app-manifest-512x512.png
349
342
  - docs/reference-facade.md
350
- - docs/scripts/post-build.mjs
343
+ - docs/scripts/sitemap-base.mjs
344
+ - docs/src/content.config.ts
345
+ - docs/src/data/sidebar.ts
346
+ - docs/src/layouts/Site.astro
347
+ - docs/src/pages/404.astro
348
+ - docs/src/pages/api/[...slug].astro
349
+ - docs/src/pages/api/index.astro
350
+ - docs/src/pages/cli/[...slug].astro
351
+ - docs/src/pages/cli/index.astro
352
+ - docs/src/pages/guide/[...slug].astro
353
+ - docs/src/pages/guide/index.astro
354
+ - docs/src/pages/history/[...slug].astro
355
+ - docs/src/pages/history/index.astro
356
+ - docs/src/pages/index.astro
357
+ - docs/src/pages/root/[...slug].astro
358
+ - docs/src/styles/site.css
351
359
  - exe/fontisan
352
360
  - ext/fontisan_cdylib/Cargo.lock
353
361
  - ext/fontisan_cdylib/Cargo.toml
@@ -1,127 +0,0 @@
1
- <template>
2
- <div class="api-method">
3
- <div class="method-header">
4
- <code class="method-signature">
5
- <span class="method-name">{{ name }}</span
6
- ><span class="method-params"
7
- >({{ params.map((p) => p.name).join(", ") }})</span
8
- >
9
- </code>
10
- <span v-if="returns" class="method-returns"> → {{ returns }}</span>
11
- </div>
12
- <p v-if="description" class="method-description">{{ description }}</p>
13
- <div v-if="params.length" class="method-params-list">
14
- <h4>Parameters</h4>
15
- <ul>
16
- <li v-for="param in params" :key="param.name">
17
- <code>{{ param.name }}</code>
18
- <span v-if="param.type" class="param-type">: {{ param.type }}</span>
19
- <span v-if="param.required" class="param-required">*</span>
20
- <span v-if="param.description" class="param-desc"
21
- >— {{ param.description }}</span
22
- >
23
- </li>
24
- </ul>
25
- </div>
26
- <div v-if="example" class="method-example">
27
- <h4>Example</h4>
28
- <pre><code :class="`language-${exampleLang}`">{{ example }}</code></pre>
29
- </div>
30
- </div>
31
- </template>
32
-
33
- <script setup lang="ts">
34
- interface Param {
35
- name: string;
36
- type?: string;
37
- required?: boolean;
38
- description?: string;
39
- }
40
-
41
- defineProps<{
42
- name: string;
43
- params?: Param[];
44
- returns?: string;
45
- description?: string;
46
- example?: string;
47
- exampleLang?: string;
48
- }>();
49
- </script>
50
-
51
- <style scoped>
52
- .api-method {
53
- margin: 1.5rem 0;
54
- padding: 1rem;
55
- border: 1px solid var(--vp-c-divider);
56
- border-radius: 8px;
57
- background: var(--vp-c-bg-soft);
58
- }
59
-
60
- .method-header {
61
- display: flex;
62
- align-items: center;
63
- gap: 0.5rem;
64
- flex-wrap: wrap;
65
- }
66
-
67
- .method-signature {
68
- font-size: 1rem;
69
- font-weight: 500;
70
- }
71
-
72
- .method-name {
73
- color: var(--vp-c-brand-1);
74
- }
75
-
76
- .method-params {
77
- color: var(--vp-c-text-2);
78
- }
79
-
80
- .method-returns {
81
- color: var(--vp-c-text-2);
82
- font-size: 0.9rem;
83
- }
84
-
85
- .method-description {
86
- margin: 0.75rem 0 0;
87
- color: var(--vp-c-text-2);
88
- }
89
-
90
- .method-params-list h4,
91
- .method-example h4 {
92
- margin: 1rem 0 0.5rem;
93
- font-size: 0.85rem;
94
- font-weight: 600;
95
- color: var(--vp-c-text-1);
96
- }
97
-
98
- .method-params-list ul {
99
- margin: 0;
100
- padding-left: 1.5rem;
101
- list-style: disc;
102
- }
103
-
104
- .method-params-list li {
105
- margin: 0.25rem 0;
106
- }
107
-
108
- .param-type {
109
- color: var(--vp-c-text-3);
110
- }
111
-
112
- .param-required {
113
- color: var(--vp-c-danger-1);
114
- }
115
-
116
- .param-desc {
117
- color: var(--vp-c-text-2);
118
- }
119
-
120
- .method-example pre {
121
- margin: 0.5rem 0;
122
- padding: 1rem;
123
- background: var(--vp-c-bg-alt);
124
- border-radius: 6px;
125
- overflow-x: auto;
126
- }
127
- </style>