module

CFF

Constants

EXPERT_CHARSET = [0, 1, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 109, 110, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 158, 155, 163, 319, 320, 321, 322, 323, 324, 325, 326, 150, 164, 169, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378].map(&.to_u16)
EXPERTSUBSET_CHARSET = [0, 1, 231, 232, 235, 236, 237, 238, 13, 14, 15, 99, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 27, 28, 249, 250, 251, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 109, 110, 267, 268, 269, 270, 272, 300, 301, 302, 305, 314, 315, 158, 155, 163, 320, 321, 322, 323, 324, 325, 326, 150, 164, 169, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346].map(&.to_u16)
FIXED_EPSILON = 1_i64
GHOST_BOTTOM = 1_u16
GHOST_TOP = 2_u16
ICF_BOTTOM = -120_i64 << 16
ICF_TOP = 880_i64 << 16
ISOADOBE_CHARSET = (0..228).map do |i| i.to_u16 end
LOCKED = 16_u16
MAX_BLUES = 7
MAX_HINT_EDGES = MAX_HINTS * 2
MAX_HINTS = 96
MAX_OTHER_BLUES = 5
MIN_COUNTER = 32768_i64
PAIR_BOTTOM = 4_u16
PAIR_TOP = 8_u16
POWER_TENS = StaticArray(Int64, 10).new do |i| (10_i64) ** i end
STANDARD_ENCODING = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, 113, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 139, 0, 0, 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, 148, 149, 0, 0, 0].map(&.to_u16)
SYNTHETIC = 32_u16

Class methods

add32(a : Int64, b : Int64) : Int64
Source
build_blend_vector(store : TT::ItemVarStore, vsindex : Int32, ndv : Array(Int64) | Nil) : Array(Int64)

cff_blend_build_vector (cffload.c): the per-region scalars for the normalized design vector, BV[0] = 1.0 for the default master. Shared by the charstring interpreter's blend operator and the CFF2 Private DICT re-parse under variations. len_ndv == 0 (no variation instance set) produces the default vector (1, 0, 0, ...).

Source
cff_random(r : UInt32) : UInt32

xorshift RNG (psobjs.c cff_random).

Source
fixed_abs(x : Int64) : Int64
Source
fixed_floor(x : Int64) : Int64
Source
fixed_fraction(x : Int64) : Int64
Source
fixed_round(x : Int64) : Int64

cf2_fixedRound / _Floor / _Fraction (psfixed.h, UInt32 arithmetic).

Source
hint_init(stems : Array(StemHint), index : Int32, hint_origin : Int64, scale : Int64, bottom : Bool) : Hint

cf2_hint_init (pshints.c): expand a StemHint into one Hint edge; `bottom' selects the bottom edge of the pair. Darkening adjustment (tops += 2*darkenY) is absent: darkenY is always 0 here. Hint is a struct, so the edge is built and returned (not mutated in place).

Source
parse_delta_fixed(d : Bytes, args : Array(Int32), limit : Int32, max : Int32) : Array(Int64)

cff_kind_delta_fixed: the same with 16.16 operands (blue arrays).

Source
parse_delta_num(d : Bytes, args : Array(Int32), limit : Int32, max : Int32) : Array(Int64)

cff_kind_delta (cffparse.c): a cumulative delta-decoded integer array, truncated to `max' entries before decoding.

Source
parse_fixed(d : Bytes, p : Int32, limit : Int32) : Int64

cff_parse_fixed (do_fixed with scaling == 0).

Source
parse_fixed_dynamic(d : Bytes, p : Int32, limit : Int32) : Tuple(Int64, Int64)

cff_parse_fixed_dynamic: {value 16.16, decimal scaling}.

Source
parse_integer(d : Bytes, p : Int32, limit : Int32) : Int64

cff_parse_integer: p' points at the first byte of the number, limit' is the exclusive end of the dict data.

Source
parse_num(d : Bytes, p : Int32, limit : Int32) : Int64

cff_parse_num: integer-valued view of an operand.

Source
parse_real(d : Bytes, start : Int32, limit : Int32, power_ten : Int64, want_scaling : Bool) : Tuple(Int64, Int64)

cff_parse_real: nibble-encoded decimal. Returns {value 16.16, scaling}. `want_scaling' selects the cff_parse_fixed_dynamic branch (used by the FontMatrix handler).

Source
sqrt_fixed(v : UInt32) : UInt32

FT_SqrtFixed (ftcalc.c, INT64 path): sqrt of a 16.16 value.

Source
sub32(a : Int64, b : Int64) : Int64
Source
subr_bias(count : Int32) : Int32

Subroutine bias (cffcalc/cffdecode.c).

Source
trace(msg : String) : Nil
Source
trace?

Opcode tracer (CFF_TRACE=1), the TT_TRACE counterpart: per-opcode dump of the VM state, zero cost when the flag is off.

Source
u16(d : Bytes, p : Int32) : UInt16
Source
u32(d : Bytes, p : Int32) : UInt32
Source
u8(d : Bytes, p : Int32) : UInt8
Source

Nested types