Fix glyph component parsing bug

This commit is contained in:
germax26 2024-09-15 16:23:49 +10:00
parent 3f60573b25
commit e90da47cfa
Signed by: germax26
SSH Key Fingerprint: SHA256:N3w+8798IMWBt7SYH8G1C0iJlIa2HIIcRCXwILT5FvM

View File

@ -5204,10 +5204,12 @@ def parse_component(f: BinaryIO) -> Component:
flag = parse_compound_glyph_flag(f)
glyphIndex = read_u16(f)
assert flag.args_are_xy_values(), "TODO: Handle point indexes"
if flag.arg_1_and_2_are_words():
argument1, argument2 = read_i16(f), read_i16(f)
else:
argument1, argument2 = read_u8(f), read_u8(f)
argument1, argument2 = read_i8(f), read_i8(f)
scaling: Optional[Scaling] = None
if flag.we_have_a_scale():