Class: Fontisan::Subset::TableStrategy::Maxp
- Inherits:
-
Object
- Object
- Fontisan::Subset::TableStrategy::Maxp
- Defined in:
- lib/fontisan/subset/table_strategy/maxp.rb
Overview
Maxp strategy: rewrite numGlyphs (offset 4, uint16) to the subset's glyph count. The remaining maxp fields describe worst- case outline/instruction complexity and can be left as-is — a smaller subset cannot exceed the source's maxima.
Class Method Summary collapse
-
.call(context:, tag:, table:) ⇒ String
Binary maxp bytes for the subset.
Class Method Details
.call(context:, tag:, table:) ⇒ String
Returns binary maxp bytes for the subset.
15 16 17 18 19 |
# File 'lib/fontisan/subset/table_strategy/maxp.rb', line 15 def self.call(context:, tag:, table:) data = table.to_binary_s.dup data[4, 2] = [context.mapping.size].pack("n") data end |