Module: Fontist

Defined in:
lib/fontist.rb,
lib/fontist/cli.rb,
lib/fontist/font.rb,
lib/fontist/repo.rb,
lib/fontist/index.rb,
lib/fontist/utils.rb,
lib/fontist/errors.rb,
lib/fontist/import.rb,
lib/fontist/update.rb,
lib/fontist/formula.rb,
lib/fontist/helpers.rb,
lib/fontist/version.rb,
lib/fontist/repo_cli.rb,
lib/fontist/utils/ui.rb,
lib/fontist/cache_cli.rb,
lib/fontist/font_path.rb,
lib/fontist/fontconfig.rb,
lib/fontist/import_cli.rb,
lib/fontist/system_font.rb,
lib/fontist/utils/cache.rb,
lib/fontist/import/macos.rb,
lib/fontist/system_index.rb,
lib/fontist/utils/system.rb,
lib/fontist/import/google.rb,
lib/fontist/style_version.rb,
lib/fontist/utils/locking.rb,
lib/fontist/font_installer.rb,
lib/fontist/fontconfig_cli.rb,
lib/fontist/formula_picker.rb,
lib/fontist/import/otf_style.rb,
lib/fontist/manifest/install.rb,
lib/fontist/utils/downloader.rb,
lib/fontist/cli/class_options.rb,
lib/fontist/import/otf_parser.rb,
lib/fontist/import/sil_import.rb,
lib/fontist/import/text_helper.rb,
lib/fontist/indexes/base_index.rb,
lib/fontist/indexes/font_index.rb,
lib/fontist/manifest/locations.rb,
lib/fontist/import/google_check.rb,
lib/fontist/import/google_import.rb,
lib/fontist/import/otf/font_file.rb,
lib/fontist/import/create_formula.rb,
lib/fontist/indexes/index_formula.rb,
lib/fontist/import/formula_builder.rb,
lib/fontist/import/template_helper.rb,
lib/fontist/indexes/filename_index.rb,
lib/fontist/import/convert_formulas.rb,
lib/fontist/import/otfinfo_generate.rb,
lib/fontist/import/formula_serializer.rb,
lib/fontist/import/files/font_detector.rb,
lib/fontist/import/helpers/hash_helper.rb,
lib/fontist/import/recursive_extraction.rb,
lib/fontist/import/files/collection_file.rb,
lib/fontist/import/helpers/system_helper.rb,
lib/fontist/import/files/file_requirement.rb,
lib/fontist/import/manual_formula_builder.rb,
lib/fontist/import/google/new_fonts_fetcher.rb,
lib/fontist/indexes/default_family_font_index.rb,
lib/fontist/import/otfinfo/otfinfo_requirement.rb,
lib/fontist/indexes/preferred_family_font_index.rb

Defined Under Namespace

Modules: Errors, Helpers, Import, Indexes, Manifest, Utils Classes: CLI, CacheCLI, Font, FontInstaller, FontPath, Fontconfig, FontconfigCLI, Formula, FormulaPicker, ImportCLI, Index, Info, Repo, RepoCLI, StyleVersion, SystemFont, SystemIndex, Update

Constant Summary collapse

VERSION =
"1.16.0".freeze

Class Method Summary collapse

Class Method Details

.default_fontist_pathObject



34
35
36
# File 'lib/fontist.rb', line 34

def self.default_fontist_path
  Pathname.new(File.join(Dir.home, ".fontist"))
end

.downloads_pathObject



70
71
72
# File 'lib/fontist.rb', line 70

def self.downloads_path
  Fontist.fontist_path.join("downloads")
end

.fontist_index_pathObject



86
87
88
# File 'lib/fontist.rb', line 86

def self.fontist_index_path
  Fontist.fontist_path.join("fontist_index.default_family.yml")
end

.fontist_pathObject



30
31
32
# File 'lib/fontist.rb', line 30

def self.fontist_path
  Pathname.new(ENV["FONTIST_PATH"] || default_fontist_path)
end

.fontist_preferred_family_index_pathObject



90
91
92
# File 'lib/fontist.rb', line 90

def self.fontist_preferred_family_index_path
  Fontist.fontist_path.join("fontist_index.preferred_family.yml")
end

.fontist_version_pathObject



46
47
48
# File 'lib/fontist.rb', line 46

def self.fontist_version_path
  Fontist.fontist_path.join("versions", formulas_version)
end

.fonts_pathObject



38
39
40
# File 'lib/fontist.rb', line 38

def self.fonts_path
  Fontist.fontist_path.join("fonts")
end

.formula_filename_index_pathObject



102
103
104
# File 'lib/fontist.rb', line 102

def self.formula_filename_index_path
  Fontist.formula_index_dir.join("filename_index.yml")
end

.formula_index_dirObject



106
107
108
# File 'lib/fontist.rb', line 106

def self.formula_index_dir
  Fontist.fontist_version_path
end

.formula_index_pathObject



94
95
96
# File 'lib/fontist.rb', line 94

def self.formula_index_path
  Fontist.formula_index_dir.join("formula_index.default_family.yml")
end

.formula_preferred_family_index_pathObject



98
99
100
# File 'lib/fontist.rb', line 98

def self.formula_preferred_family_index_path
  Fontist.formula_index_dir.join("formula_index.preferred_family.yml")
end

.formula_size_limit_in_megabytesObject



110
111
112
# File 'lib/fontist.rb', line 110

def self.formula_size_limit_in_megabytes
  300
end

.formulas_pathObject



58
59
60
# File 'lib/fontist.rb', line 58

def self.formulas_path
  @formulas_path || Fontist.formulas_repo_path.join("Formulas")
end

.formulas_path=(path) ⇒ Object



62
63
64
# File 'lib/fontist.rb', line 62

def self.formulas_path=(path)
  @formulas_path = path
end

.formulas_repo_pathObject



42
43
44
# File 'lib/fontist.rb', line 42

def self.formulas_repo_path
  Fontist.fontist_version_path.join("formulas")
end

.formulas_repo_urlObject



54
55
56
# File 'lib/fontist.rb', line 54

def self.formulas_repo_url
  "https://github.com/fontist/formulas.git"
end

.formulas_versionObject



50
51
52
# File 'lib/fontist.rb', line 50

def self.formulas_version
  "v3"
end

.lib_pathObject



22
23
24
# File 'lib/fontist.rb', line 22

def self.lib_path
  Fontist.root_path.join("lib")
end

.log_level=(level) ⇒ Object



122
123
124
# File 'lib/fontist.rb', line 122

def self.log_level=(level)
  Fontist.ui.level = level
end

.preferred_family=(bool) ⇒ Object



118
119
120
# File 'lib/fontist.rb', line 118

def self.preferred_family=(bool)
  @preferred_family = bool
end

.preferred_family?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/fontist.rb', line 114

def self.preferred_family?
  !!@preferred_family
end

.private_formulas_pathObject



66
67
68
# File 'lib/fontist.rb', line 66

def self.private_formulas_path
  Fontist.formulas_path.join("private")
end

.root_pathObject



26
27
28
# File 'lib/fontist.rb', line 26

def self.root_path
  Pathname.new(File.dirname(__dir__))
end

.system_file_pathObject



74
75
76
# File 'lib/fontist.rb', line 74

def self.system_file_path
  Fontist.lib_path.join("fontist", "system.yml")
end

.system_index_pathObject



78
79
80
# File 'lib/fontist.rb', line 78

def self.system_index_path
  Fontist.fontist_path.join("system_index.default_family.yml")
end

.system_preferred_family_index_pathObject



82
83
84
# File 'lib/fontist.rb', line 82

def self.system_preferred_family_index_path
  Fontist.fontist_path.join("system_index.preferred_family.yml")
end

.uiObject



18
19
20
# File 'lib/fontist.rb', line 18

def self.ui
  Fontist::Utils::UI
end