fontisan 0.4.54 → 0.4.56

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +1 -1
  3. data/docs/.gitignore +4 -0
  4. data/docs/astro.config.mjs +16 -0
  5. data/docs/package-lock.json +4022 -1496
  6. data/docs/package.json +12 -5
  7. data/docs/scripts/sitemap-base.mjs +81 -0
  8. data/docs/src/content.config.ts +32 -0
  9. data/docs/{.vitepress/config.ts → src/data/sidebar.ts} +235 -146
  10. data/docs/src/layouts/Site.astro +320 -0
  11. data/docs/src/pages/404.astro +14 -0
  12. data/docs/src/pages/api/[...slug].astro +22 -0
  13. data/docs/src/pages/api/index.astro +12 -0
  14. data/docs/src/pages/cli/[...slug].astro +22 -0
  15. data/docs/src/pages/cli/index.astro +12 -0
  16. data/docs/src/pages/guide/[...slug].astro +22 -0
  17. data/docs/src/pages/guide/index.astro +12 -0
  18. data/docs/src/pages/history/[...slug].astro +22 -0
  19. data/docs/src/pages/history/index.astro +24 -0
  20. data/docs/src/pages/index.astro +234 -0
  21. data/docs/src/pages/root/[...slug].astro +20 -0
  22. data/docs/src/styles/site.css +88 -0
  23. data/ext/fontisan_cdylib/Cargo.lock +1 -1
  24. data/ext/fontisan_cdylib/Cargo.toml +1 -1
  25. data/ext/fontisan_native/Cargo.toml +1 -1
  26. data/lib/fontisan/byte_ops.rb +0 -5
  27. data/lib/fontisan/native.rb +1 -1
  28. data/lib/fontisan/version.rb +1 -1
  29. data/lib/fontisan.rb +30 -15
  30. metadata +18 -10
  31. data/docs/.vitepress/theme/components/ApiMethod.vue +0 -127
  32. data/docs/.vitepress/theme/components/Badge.vue +0 -51
  33. data/docs/.vitepress/theme/components/FeatureComparison.vue +0 -87
  34. data/docs/.vitepress/theme/components/HeroCodeBlock.vue +0 -98
  35. data/docs/.vitepress/theme/components/WithinHero.vue +0 -30
  36. data/docs/.vitepress/theme/index.ts +0 -22
  37. data/docs/.vitepress/theme/style.css +0 -628
  38. 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; }
@@ -135,7 +135,7 @@ dependencies = [
135
135
  [[package]]
136
136
  name = "fontisan"
137
137
  version = "0.0.0"
138
- source = "git+https://github.com/fontist/fontisan-rs?rev=4cf3789693ffcf43d9312308017620ab5c817bb5#4cf3789693ffcf43d9312308017620ab5c817bb5"
138
+ source = "git+https://github.com/fontist/fontisan-rs?rev=89c64de798794e271e289a3f51ec394eb7db3fee#89c64de798794e271e289a3f51ec394eb7db3fee"
139
139
  dependencies = [
140
140
  "brotli",
141
141
  "brotli-decompressor",
@@ -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 = "4cf3789693ffcf43d9312308017620ab5c817bb5", 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 = "4cf3789693ffcf43d9312308017620ab5c817bb5" }
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
 
@@ -115,11 +115,6 @@ module Fontisan
115
115
  return %i[woff woff2].include?(source)
116
116
  end
117
117
 
118
- # A variable source keeps the type1 conversion with Ruby: the goldens
119
- # pin the pipeline's instanced bytes, and the engine's instancing walk
120
- # is not byte-identical to the pipeline's for type1 output yet.
121
- return false if target == :type1 && variable_font?(path)
122
-
123
118
  (collection_file?(path) ? COLLECTION_TARGETS : SINGLE_TARGETS).include?(target)
124
119
  end
125
120
 
@@ -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 = "4cf3789693ffcf43d9312308017620ab5c817bb5"
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.54"
4
+ VERSION = "0.4.56"
5
5
  end
data/lib/fontisan.rb CHANGED
@@ -35,25 +35,40 @@ require "stringio"
35
35
  require "tmpdir"
36
36
  require "lutaml/model"
37
37
 
38
- # The XML engine behind lutaml-model, chosen by what actually loads on
39
- # this machine: leptris (pure-C99, precompiled everywhere) when its
40
- # library loads, then nokogiri if present, then REXML (stdlib). The
41
- # probe is load-bearing: leptris's precompiled linux builds need
38
+ # The XML engine behind lutaml-model: leptris (pure-C99, precompiled
39
+ # everywhere) when its library loads AND the bundled lutaml-model knows it,
40
+ # then nokogiri if present, then REXML (stdlib). Both probes are
41
+ # load-bearing. The library probe: leptris's precompiled linux builds need
42
42
  # glibc >= 2.34, and forcing the adapter on an older glibc would crash
43
- # every boot — e.g. inside the rake-compiler-dock cross builds.
44
- xml_adapter = begin
45
- require "leptris"
46
- :leptris
43
+ # every boot — e.g. inside the rake-compiler-dock cross builds. The
44
+ # acceptance probe: the leptris adapter exists in lutaml-model only since
45
+ # 0.8.158, and a bundle may legally hold an older one (any 0.8.x satisfies
46
+ # fontisan; a rubyzip 2.3 pin elsewhere resolves lutaml-model to 0.8.14),
47
+ # where lutaml-model raises at configure time and took every boot down.
48
+ loadable = lambda do |library|
49
+ require library
50
+ true
47
51
  rescue LoadError
48
- begin
49
- require "nokogiri"
50
- :nokogiri
51
- rescue LoadError
52
- :rexml
52
+ false
53
+ end
54
+
55
+ accepted = lambda do |adapter|
56
+ Lutaml::Model::Config.configure do |config|
57
+ config.xml_adapter_type = adapter
53
58
  end
59
+ true
60
+ rescue ArgumentError
61
+ false
54
62
  end
55
- Lutaml::Model::Config.configure do |config|
56
- config.xml_adapter_type = xml_adapter
63
+
64
+ # [adapter, library to probe]; rexml is stdlib, so there is nothing to probe.
65
+ xml_adapter = [[:leptris, "leptris"], [:nokogiri, "nokogiri"], [:rexml, nil]].find do |adapter, library|
66
+ (library.nil? || loadable.call(library)) && accepted.call(adapter)
67
+ end
68
+
69
+ unless xml_adapter
70
+ # Nothing was accepted: let lutaml-model's own error surface.
71
+ Lutaml::Model::Config.configure { |config| config.xml_adapter_type = :rexml }
57
72
  end
58
73
 
59
74
  module Fontisan
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.54
4
+ version: 0.4.56
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>