This commit is contained in:
John Whitington 2022-11-23 16:10:32 +00:00
parent a257ce355a
commit 65e4b8c027
1 changed files with 10 additions and 9 deletions

View File

@ -303,9 +303,7 @@ let padword n =
let fonumr = ref (-1) let fonumr = ref (-1)
let fonum () = let fonum () = fonumr += 1; !fonumr
fonumr += 1;
!fonumr
let subset_font major minor tables indexToLocFormat subset encoding cmap loca mk_b glyfoffset data = let subset_font major minor tables indexToLocFormat subset encoding cmap loca mk_b glyfoffset data =
let tables = Array.of_list (sort (fun (_, _, o, _) (_, _, o', _) -> compare o o') tables) in let tables = Array.of_list (sort (fun (_, _, o, _) (_, _, o', _) -> compare o o') tables) in
@ -406,12 +404,15 @@ let subset_font major minor tables indexToLocFormat subset encoding cmap loca mk
with with
_ -> ()) _ -> ())
newtables; newtables;
let bytes = bytes_of_write_bitstream bs in let obs = bytes_of_write_bitstream bs in
if !dbg then Printf.printf "Made subset font of length %i bytes\n" (bytes_size bytes); if !dbg then
begin
Printf.printf "Made subset font of length %i bytes\n" (bytes_size obs);
let o = open_out_bin ("fontout" ^ string_of_int (fonum ()) ^ ".ttf") in let o = open_out_bin ("fontout" ^ string_of_int (fonum ()) ^ ".ttf") in
output_string o (string_of_bytes bytes); output_string o (string_of_bytes obs);
close_out o; close_out o
bytes end;
obs
let parse ?(subset=[]) data encoding = let parse ?(subset=[]) data encoding =
Printf.printf "********SUBSET is "; Printf.printf "********SUBSET is ";