Skip to content

Commit

Permalink
Use supported? rather than a numeric comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
practicingruby committed Aug 29, 2014
1 parent e8302f2 commit 23af5c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ttfunk/table/cmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23af5c8

Please sign in to comment.