Class: Mathtype::RecordChar

Inherits:
BinData::Record
  • Object
show all
Includes:
Snapshot
Defined in:
lib/records/char.rb

Constant Summary collapse

EXPOSED_IN_SNAPSHOT =
%i(nudge typeface mt_code_value options font_position
variation embellishment_list)

Instance Method Summary collapse

Methods included from Snapshot

#snapshot

Instance Method Details

#mt_code_valueObject



67
68
69
70
71
72
73
74
75
# File 'lib/records/char.rb', line 67

def mt_code_value
  mt_code = if _mt_code_value < 0
    65536 + _mt_code_value # Two's complement
  else
    _mt_code_value
  end

  sprintf("0x%04X", mt_code)
end

#typefaceObject



77
78
79
# File 'lib/records/char.rb', line 77

def typeface
  _typeface + 128
end

#variationObject



81
82
83
84
85
86
87
88
# File 'lib/records/char.rb', line 81

def variation
  case typeface
  when 1, 9, 10
    "textmode"
  else
    "mathmode"
  end
end