more double-calling

This commit is contained in:
John Whitington 2023-07-07 20:59:48 +01:00
parent 66f964bba3
commit 17ddf4a766
1 changed files with 17 additions and 17 deletions

View File

@ -2,12 +2,12 @@
open Pdfutil open Pdfutil
open Pdfio open Pdfio
(* FIXME Proper widths for .notdef, and warn on .notdef being produced *)
(* FIXME Add suport for composite glyphs *)
(* FIXME Make sure -add-text and -table-of-contents call subset once only *) (* FIXME Make sure -add-text and -table-of-contents call subset once only *)
(* FIXME Make it work with -draw *) (* FIXME Make it work with -draw *)
(* FIXME Base on bytes not bits *) (* FIXME Proper widths for .notdef, and warn on .notdef being produced *)
(* FIXME Add suport for composite glyphs *)
(* FIXME Make sure -embed-std14 works for all commands *) (* FIXME Make sure -embed-std14 works for all commands *)
(* FIXME Base on bytes not bits *)
let dbg = ref false let dbg = ref false
let _ = let _ =
@ -60,8 +60,8 @@ let required_tables =
let read_fixed b = let read_fixed b =
let a = getval_31 b 16 in let a = getval_31 b 16 in
let b = getval_31 b 16 in let b = getval_31 b 16 in
a, b a, b
let read_ushort b = getval_31 b 16 let read_ushort b = getval_31 b 16
@ -234,18 +234,18 @@ let write_loca_table subset cmap indexToLocFormat bs loca =
(sort compare (map fst (list_of_hashtbl locnums))) (sort compare (map fst (list_of_hashtbl locnums)))
in in
let pairs = Array.of_list (pairs @ [(Array.length loca - 1, !pos)]) in let pairs = Array.of_list (pairs @ [(Array.length loca - 1, !pos)]) in
Array.iteri Array.iteri
(fun i (loc, off) -> (fun i (loc, off) ->
if i <> Array.length pairs - 1 then if i <> Array.length pairs - 1 then
begin begin
write_entry loc off; write_entry loc off;
let loc', off' = pairs.(i + 1) in let loc', off' = pairs.(i + 1) in
for x = 0 to loc' - loc - 2 do write_entry (loc + x) off' done for x = 0 to loc' - loc - 2 do write_entry (loc + x) off' done
end end
else else
write_entry loc off) write_entry loc off)
pairs; pairs;
for x = 1 to padding !len do putval bs 8 0l done for x = 1 to padding !len do putval bs 8 0l done
(* Write the notdef glyf, and any others in the subset *) (* Write the notdef glyf, and any others in the subset *)
let write_glyf_table subset cmap bs mk_b glyfoffset loca = let write_glyf_table subset cmap bs mk_b glyfoffset loca =