Class: Fontist::Indexes::SystemIndex

Inherits:
BaseFontCollectionIndex show all
Defined in:
lib/fontist/indexes/system_index.rb

Overview

Index for fonts in system font directories

This index tracks all fonts in platform-specific system font directories using a singleton pattern to ensure consistent state across the application.

## Responsibilities

  • Maintain index of all system-installed fonts

  • Provide fast font lookups by name and style

  • Auto-rebuild when font directories change

  • Cache results for performance

## Index File

Located at: ~/.fontist/system_index.default_family.yml

## Platform-Specific Paths Indexed

Scans all system font directories as defined in system.yml:

  • macOS: /System/Library/Fonts/, /Library/Fonts/, ~/Library/Fonts/

  • Linux: /usr/share/fonts/, /usr/local/share/fonts/, ~/.fonts/

  • Windows: %windir%/Fonts/, various system directories

## Usage

index = Fontist::Indexes::SystemIndex.instance
fonts = index.find("Arial", "Bold")
index.add_font("/Library/Fonts/Arial.ttf")
index.rebuild(verbose: true)

Method Summary

Methods inherited from BaseFontCollectionIndex

#add_font, #collection, #find, #font_exists?, #fonts, #initialize, #read_only_mode, #rebuild, #remove_font, reset_cache, #reset_cache

Constructor Details

This class inherits a constructor from Fontist::Indexes::BaseFontCollectionIndex