file-parser/OpenFontFormat/erl/table.erl

15 lines
627 B
Erlang
Raw Normal View History

2024-05-03 21:04:21 +10:00
-module(table).
-export([parse_table/4]).
-import(head, [parse_head_table/1]).
-import(hhea, [parse_hhea_table/1]).
-import(maxp, [parse_maxp_table/1]).
-import(hmtx, [parse_hmtx_table/1]).
parse_table(head, Table, _, _) -> parse_head_table(Table);
parse_table(hhea, Table, _, _) -> parse_hhea_table(Table);
parse_table(maxp, Table, _, _) -> parse_maxp_table(Table);
parse_table(hmtx, Table, _, Info) ->
[{number_of_h_metrics, NumberOfHMetrics}, {num_glyphs, NumGlyphs}] = Info,
parse_hmtx_table(<<NumberOfHMetrics:16, NumGlyphs:16, Table/binary>>);
parse_table(TableTag, _, _, _) -> throw({unimplemented_table, TableTag}).