15 lines
627 B
Erlang
15 lines
627 B
Erlang
|
-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}).
|