From 23af5c89c23ed7c5da8cc1984662a9a1459a0bb0 Mon Sep 17 00:00:00 2001 From: Gregory Brown Date: Fri, 29 Aug 2014 07:03:02 -0400 Subject: [PATCH] Use supported? rather than a numeric comparison --- lib/ttfunk/table/cmap.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ttfunk/table/cmap.rb b/lib/ttfunk/table/cmap.rb index 02c64978..5768b656 100644 --- a/lib/ttfunk/table/cmap.rb +++ b/lib/ttfunk/table/cmap.rb @@ -13,10 +13,10 @@ def self.encode(charmap, encoding) end def unicode - # Because most callers just call .first on the result, put tables with highest-number format first. - # However, ignore tables with a format number greater than 12 since ttfunk doesn't support them - # (Tables with higher format numbers tend to be more complete, especially in higher/astral Unicode ranges.) - @unicode ||= @tables.select { |table| table.unicode? && table.format <= 12 }.sort{|a,b| b.format <=> a.format } + # Because most callers just call .first on the result, put tables with + # highest-number format first. Unsupported formats will be ignored. + @unicode ||= @tables.select { |table| table.unicode? && table.supported? } + .sort{|a,b| b.format <=> a.format } end private