Class: Ucode::Glyphs::RealFonts::FontLocator
- Inherits:
-
Object
- Object
- Ucode::Glyphs::RealFonts::FontLocator
- Defined in:
- lib/ucode/glyphs/real_fonts/font_locator.rb
Overview
Resolves a user-provided font specifier to a concrete file path on disk. Resolution order:
1. Direct file path — returns it if it exists. Useful for
local checkouts (e.g. a developer's clone of Lentariso).
2. `Fontist::Font.find(name)` — returns the already-installed
font path if fontist has it on disk.
3. `Fontist::Font.install(name)` — downloads + installs the
font via the fontist formula index.
Fontist is the canonical discovery layer for the fontist ecosystem. We never reach into other package managers or hardcode URLs here — formulas live in fontist/formulas.
Defined Under Namespace
Classes: LocateResult
Instance Method Summary collapse
Instance Method Details
#locate(spec, install: true) ⇒ LocateResult
35 36 37 38 39 40 41 42 43 |
# File 'lib/ucode/glyphs/real_fonts/font_locator.rb', line 35 def locate(spec, install: true) name, path = split_spec(spec) return result(name, path, :direct) if path && File.exist?(path) via_fontist = find_via_fontist(name, install: install) return via_fontist if via_fontist raise Errno::ENOENT, "Font not found: #{spec}" end |