lib/fontist/import/files/collection_file.rb in fontist-1.13.2 vs lib/fontist/import/files/collection_file.rb in fontist-1.14.0
- old
+ new
@@ -24,13 +24,13 @@
private
def read
switch_to_temp_dir do |tmp_dir|
- extract_ttfs(tmp_dir).map do |path|
- Otf::FontFile.new(path)
- end
+ extract_ttfs(tmp_dir)
+ .map { |path| Otf::FontFile.new(path) }
+ .reject { |font_file| hidden_or_pua_encoded?(font_file) }
end
end
def switch_to_temp_dir
Dir.mktmpdir do |tmp_dir|
@@ -43,9 +43,13 @@
def extract_ttfs(tmp_dir)
filenames = ExtractTtc.extract(@path)
filenames.map do |filename|
File.join(tmp_dir, filename)
end
+ end
+
+ def hidden_or_pua_encoded?(font_file)
+ font_file.family_name.start_with?(".")
end
def detect_extension
base_extension = "ttc"