ea 0.6.17 → 0.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/tasks/fonts.rake CHANGED
@@ -3,30 +3,35 @@
3
3
  require "ea/fonts/metrics"
4
4
 
5
5
  namespace :fonts do
6
- desc "Validate the shipped Carlito metrics against Fontist-resolved TTFs"
6
+ desc "Validate the shipped font metrics against Fontist-resolved TTFs"
7
7
  task :validate do
8
- files = Ea::Fonts::Metrics.carlito_font_files
9
- abort "Carlito not resolvable via Fontist — install it first" if files.empty?
10
-
11
8
  shipped = JSON.parse(File.read(Ea::Fonts::Metrics::DATA_PATH))["advance"]
12
9
  style_key = { "regular" => "regular", "bold" => "bold",
13
10
  "italic" => "italic", "bold_italic" => "bold_italic",
14
11
  "bolditalic" => "bold_italic" }
15
12
  drift = []
16
13
 
17
- files.each do |style, path|
18
- table = shipped[style_key[style.downcase]]
19
- actual = Ea::Fonts::Metrics.advances_from_font(path)
20
- missing = actual.keys.count { |cp| table[format("U+%04X", cp)].nil? }
21
- puts " (shipped table lacks #{missing} of #{actual.size} codepoints — skipped)"
22
- actual.each do |cp, adv|
23
- key = format("U+%04X", cp)
24
- ours = table[key]
25
- next if ours.nil? || (ours - adv).abs <= 0.0005
14
+ shipped.keys.each do |family|
15
+ files = Ea::Fonts::Metrics.font_files_for(family)
16
+ if files.empty?
17
+ puts "#{family}: NOT RESOLVABLE VIA FONTIST — skipped"
18
+ next
19
+ end
20
+
21
+ files.each do |style, path|
22
+ table = shipped[family][style_key[style.downcase]] || {}
23
+ actual = Ea::Fonts::Metrics.advances_from_font(path)
24
+ missing = actual.keys.count { |cp| table[format("U+%04X", cp)].nil? }
25
+ puts " (shipped #{family}/#{style} table lacks #{missing} of #{actual.size} codepoints — skipped)"
26
+ actual.each do |cp, adv|
27
+ key = format("U+%04X", cp)
28
+ ours = table[key]
29
+ next if ours.nil? || (ours - adv).abs <= 0.0005
26
30
 
27
- drift << format("%s %s: json=%s font=%s", style, key, ours, adv)
31
+ drift << format("%s/%s %s: json=%s font=%s", family, style, key, ours, adv)
32
+ end
33
+ puts "#{family}/#{style}: #{path} — #{actual.size} codepoints checked"
28
34
  end
29
- puts "#{style}: #{path} — #{actual.size} codepoints checked"
30
35
  end
31
36
 
32
37
  if drift.empty?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.17
4
+ version: 0.6.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-01 00:00:00.000000000 Z
11
+ date: 2026-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model