Class: Ucode::Commands::GlyphsCommand
- Inherits:
-
Object
- Object
- Ucode::Commands::GlyphsCommand
- Defined in:
- lib/ucode/commands/glyphs.rb
Overview
‘ucode glyphs` — extract per-codepoint SVGs from Code Charts PDFs. Builds block specs from the cached Blocks.txt + per-block PDFs (or monolith fallback), then drains them through the Glyphs::Writer worker pool.
**Status (v0.1): EXPERIMENTAL.** The cell-extraction pipeline currently includes cell-border decorations alongside the actual character outline because the Code Charts PDFs composite the two into a single glyph definition. The output is therefore not yet suitable for end-user display. The command is retained so the pipeline can be iterated on without churning the CLI surface, but callers MUST opt in via ‘include_glyphs: true` (CLI: `–include-glyphs`) and will receive a printed warning. Tracked for v0.2.
Class Method Summary collapse
-
.experimental_warning ⇒ String
The experimental-status banner.
Instance Method Summary collapse
-
#call(version_intent, output_root:, block_filter: nil, force: false, monolith_path: MonolithPath, include_glyphs: false, warn: nil) ⇒ Hash
Aggregated Writer tally + version, or a ‘skipped` payload when opt-in is false.
Class Method Details
.experimental_warning ⇒ String
Returns the experimental-status banner. Exposed so the CLI and BuildCommand surface the same message verbatim.
39 40 41 |
# File 'lib/ucode/commands/glyphs.rb', line 39 def experimental_warning ExperimentalWarning end |
Instance Method Details
#call(version_intent, output_root:, block_filter: nil, force: false, monolith_path: MonolithPath, include_glyphs: false, warn: nil) ⇒ Hash
Returns aggregated Writer tally + version, or a ‘skipped` payload when opt-in is false.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ucode/commands/glyphs.rb', line 58 def call(version_intent, output_root:, block_filter: nil, force: false, monolith_path: MonolithPath, include_glyphs: false, warn: nil) return skipped(version_intent) unless include_glyphs warn&.puts(ExperimentalWarning) version = VersionResolver.resolve(version_intent) root = Pathname.new(output_root) blocks = load_blocks(version, block_filter) fetcher = build_fetcher(version, monolith_path, blocks) specs = blocks.map { |block| spec_for(block, fetcher, force) }.compact writer = Glyphs::Writer.new(output_root: root, parallel_workers: workers) tally = writer.write_all(specs) tally.merge(version: version, block_count: specs.size) end |