-module(maxp). -export([parse_maxp_table/1]). -import(read_utils, [read_fixed_version/1]). -include("sizes.hrl"). parse_maxp_table( <>) -> Version = read_fixed_version(FixedVersion), case lists:member(Version, [0.5, 1.0]) of false -> throw({invalid_version, Version}); true -> if Version == 0.5 -> [ {version, Version}, {num_glyphs, NumGlyphs} ]; true -> << MaxPoints:16, MaxContours:16, MaxCompositePoints:16, MaxCompositeContours:16, MaxZones:16, MaxTwilightPoints:16, MaxStorage:16, MaxFunctionDefs:16, MaxInstructionDefs:16, MaxStackElements:16, MaxSizeOfInstructions:16, MaxComponentElements:16, MaxComponentDepth:16, _/binary >> = Tail, [ {version, Version}, {num_glyphs, NumGlyphs}, {max_points, MaxPoints}, {max_contours, MaxContours}, {max_composite_points, MaxCompositePoints}, {max_composite_contours, MaxCompositeContours}, {max_zones, MaxZones}, {max_twilight_points, MaxTwilightPoints}, {max_storage, MaxStorage}, {max_function_defs, MaxFunctionDefs}, {max_instruction_defs, MaxInstructionDefs}, {max_stack_elements, MaxStackElements}, {max_size_of_instructions, MaxSizeOfInstructions}, {max_component_elements, MaxComponentElements}, {max_component_depth, MaxComponentDepth} ] end end.