From 5a1ed12e22b6f6ad3f7c5f89c953982abde99a93 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Dec 14 2018 10:45:17 +0000 Subject: Colorize the changed families only --- diff --git a/fontstable/bin/gen-comp-table.rb b/fontstable/bin/gen-comp-table.rb index ff78d07..cc009cf 100755 --- a/fontstable/bin/gen-comp-table.rb +++ b/fontstable/bin/gen-comp-table.rb @@ -81,11 +81,11 @@ print "" fmout = Proc.new do |pos, n, pkg, weight, style, color, family| - sprintf("\n", - pos, n, pkg, weight, style, color, family) + sprintf("\n", + pos, n, pkg, weight, style, pos, n, family) end data.each do |k,v| - printf("\n", + printf("\n", v.length, k, v[0][2]) currentfamilies = [nil, nil, nil] cond = [nil, nil, nil] @@ -97,6 +97,7 @@ data.each do |k,v| result << sprintf("", title[i]) if currentfamilies[0] != v[i][7] || cond[0] != v[i][6] then result.gsub!(/__n_sans_#{b_eq[0]}__/, n_eq[0].to_s) + result.gsub!(/__n_sans_#{b_eq[0]}_color__/, n_eq[0] == 1 ? 'orange' : '#000000') currentfamilies[0] = v[i][7] cond[0] = v[i][6] b_eq[0] = i @@ -107,6 +108,7 @@ data.each do |k,v| end if currentfamilies[1] != v[i][12] || cond[1] != v[i][11] then result.gsub!(/__n_serif_#{b_eq[1]}__/, n_eq[1].to_s) + result.gsub!(/__n_serif_#{b_eq[1]}_color__/, n_eq[1] == 1 ? 'orange' : '#000000') currentfamilies[1] = v[i][12] cond[1] = v[i][11] b_eq[1] = i @@ -117,6 +119,7 @@ data.each do |k,v| end if currentfamilies[2] != v[i][17] || cond[2] != v[i][16] then result.gsub!(/__n_mono_#{b_eq[2]}__/, n_eq[2].to_s) + result.gsub!(/__n_mono_#{b_eq[2]}_color__/, n_eq[2] == 1 ? 'orange' : '#000000') currentfamilies[2] = v[i][17] cond[2] = v[i][16] b_eq[2] = i @@ -130,6 +133,9 @@ data.each do |k,v| result.gsub!(/__n_sans_#{b_eq[0]}__/, n_eq[0].to_s) result.gsub!(/__n_serif_#{b_eq[1]}__/, n_eq[1].to_s) result.gsub!(/__n_mono_#{b_eq[2]}__/, n_eq[2].to_s) + result.gsub!(/__n_sans_#{b_eq[0]}_color__/, n_eq[0] == 1 ? 'orange' : '#000000') + result.gsub!(/__n_serif_#{b_eq[1]}_color__/, n_eq[1] == 1 ? 'orange' : '#000000') + result.gsub!(/__n_mono_#{b_eq[2]}_color__/, n_eq[2] == 1 ? 'orange' : '#000000') print result end print "\n"
%s%s
%s
%s%s