lib/fontist/manifest/locations.rb in fontist-1.7.3 vs lib/fontist/manifest/locations.rb in fontist-1.8.1
- old
+ new
@@ -51,10 +51,18 @@
file_paths(font, style)
end
end
def file_paths(font, style)
- Fontist::SystemFont.find_with_name(font, style).transform_keys(&:to_s)
+ find_font_with_name(font, style).tap do |x|
+ if x["paths"].empty?
+ raise Errors::MissingFontError.new("Could not find font #{font} #{style}.")
+ end
+ end
+ end
+
+ def find_font_with_name(font, style)
+ Fontist::SystemFont.find_with_name(font, style).map { |k, v| [k.to_s, v] }.to_h
end
end
end
end