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/config.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_file.rb,
lib/fontist/font_path.rb,
lib/fontist/config_cli.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/collection_file.rb,
lib/fontist/import/otf_style.rb,
lib/fontist/manifest/install.rb,
lib/fontist/utils/downloader.rb,
lib/fontist/utils/file_magic.rb,
lib/fontist/cli/class_options.rb,
lib/fontist/import/otf_parser.rb,
lib/fontist/import/sil_import.rb,
lib/fontist/formula_suggestion.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, CollectionFile, Config, ConfigCLI, Font, FontFile, FontInstaller, FontPath, Fontconfig, FontconfigCLI, Formula, FormulaPicker, FormulaSuggestion, ImportCLI, Index, Info, Repo, RepoCLI, StyleVersion, SystemFont, SystemIndex, Update

Constant Summary collapse

VERSION =
"1.20.0".freeze

Class Method Summary collapse

Class Method Details

.configObject



135
136
137
# File 'lib/fontist.rb', line 135

def self.config
  Fontist::Config.instance.values
end

.config_pathObject



139
140
141
# File 'lib/fontist.rb', line 139

def self.config_path
  Fontist.fontist_path.join("config.yml")
end

.default_fontist_pathObject



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

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

.downloads_pathObject



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

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

.excluded_fonts_pathObject



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

def self.excluded_fonts_path
  Fontist.lib_path.join("fontist", "exclude.yml")
end

.fontist_index_pathObject



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

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

.fontist_pathObject



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

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

.fontist_preferred_family_index_pathObject



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

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

.fontist_version_pathObject



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

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

.fonts_pathObject



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

def self.fonts_path
  Pathname.new(config[:fonts_path])
end

.formula_filename_index_pathObject



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

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

.formula_index_dirObject



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

def self.formula_index_dir
  Fontist.fontist_version_path
end

.formula_index_pathObject



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

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

.formula_preferred_family_index_pathObject



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

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

.formula_size_limit_in_megabytesObject



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

def self.formula_size_limit_in_megabytes
  300
end

.formulas_pathObject



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

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

.formulas_path=(path) ⇒ Object



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

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

.formulas_repo_pathObject



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

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

.formulas_repo_urlObject



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

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

.formulas_versionObject



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

def self.formulas_version
  "v3"
end

.interactive=(bool) ⇒ Object



159
160
161
# File 'lib/fontist.rb', line 159

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

.interactive?Boolean

Returns:

  • (Boolean)


155
156
157
# File 'lib/fontist.rb', line 155

def self.interactive?
  @interactive || false
end

.lib_pathObject



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

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

.log_level=(level) ⇒ Object



151
152
153
# File 'lib/fontist.rb', line 151

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

.open_timeoutObject



127
128
129
# File 'lib/fontist.rb', line 127

def self.open_timeout
  config[:open_timeout]
end

.preferred_family=(bool) ⇒ Object



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

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

.preferred_family?Boolean

Returns:

  • (Boolean)


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

def self.preferred_family?
  !!@preferred_family
end

.private_formulas_pathObject



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

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

.read_timeoutObject



131
132
133
# File 'lib/fontist.rb', line 131

def self.read_timeout
  config[:read_timeout]
end

.root_pathObject



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

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

.system_file_pathObject



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

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

.system_index_pathObject



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

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

.system_preferred_family_index_pathObject



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

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

.uiObject



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

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

.use_cache=(bool) ⇒ Object



147
148
149
# File 'lib/fontist.rb', line 147

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

.use_cache?Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/fontist.rb', line 143

def self.use_cache?
  instance_variable_defined?("@use_cache") ? @use_cache : true
end