Class: Fontist::SystemIndex

Inherits:
Object
  • Object
show all
Includes:
Utils::Locking
Defined in:
lib/fontist/system_index.rb

Class Method Summary collapse

Methods included from Utils::Locking

#lock

Class Method Details

.fontist_indexObject



243
244
245
246
247
248
249
250
251
252
# File 'lib/fontist/system_index.rb', line 243

def self.fontist_index
  current_path = Fontist.fontist_index_path
  return @fontist_index if !@fontist_index.nil? && @fontist_index_path == current_path

  @fontist_index_path = current_path
  @fontist_index = SystemIndexFontCollection.from_file(
    path: current_path,
    paths_loader: -> { SystemFont.fontist_font_paths },
  )
end

.system_indexObject



232
233
234
235
236
237
238
239
240
241
# File 'lib/fontist/system_index.rb', line 232

def self.system_index
  current_path = Fontist.system_index_path
  return @system_index if !@system_index.nil? && @system_index_path == current_path

  @system_index_path = current_path
  @system_index = SystemIndexFontCollection.from_file(
    path: current_path,
    paths_loader: -> { SystemFont.font_paths },
  )
end