Class: TTFunk::Table::Cff::SubrIndex

Inherits:
Index show all
Defined in:
lib/ttfunk/table/cff/subr_index.rb

Overview

CFF Subroutine index.

Instance Attribute Summary

Attributes inherited from SubTable

#file, #length, #table_offset

Instance Method Summary collapse

Methods inherited from Index

#[], #each, #encode, #items_count

Methods inherited from SubTable

#eot?, #initialize, #read

Constructor Details

This class inherits a constructor from TTFunk::SubTable

Instance Method Details

#biasInteger

Subroutine index biase. For correct subroutine selection the calculated bias must be added to the subroutine number operand before accessing the index.

Returns:

  • (Integer)


12
13
14
15
16
17
18
19
20
# File 'lib/ttfunk/table/cff/subr_index.rb', line 12

def bias
  if items.length < 1240
    107
  elsif items.length < 33_900
    1131
  else
    32_768
  end
end