mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-04-28 16:58:45 +02:00
Finishing for week
This commit is contained in:
parent
c6b9412c0b
commit
521cf72a1e
@ -2,7 +2,7 @@
|
|||||||
open Pdfutil
|
open Pdfutil
|
||||||
open Pdfio
|
open Pdfio
|
||||||
|
|
||||||
let dbg = ref false
|
let dbg = ref true
|
||||||
|
|
||||||
type t =
|
type t =
|
||||||
{flags : int;
|
{flags : int;
|
||||||
@ -235,7 +235,7 @@ let write_glyf_table subset cmap bs mk_b glyfoffset loca =
|
|||||||
iter
|
iter
|
||||||
(fun u ->
|
(fun u ->
|
||||||
let locnum = Hashtbl.find cmap u in
|
let locnum = Hashtbl.find cmap u in
|
||||||
if !dbg then Printf.printf "write_glyf_table: Unicode %i is at location number %i\n" u locnum;
|
if !dbg then Printf.printf "write_glyf_table: Unicode U+%04X is at location number %i\n" u locnum;
|
||||||
Hashtbl.add locnums locnum ())
|
Hashtbl.add locnums locnum ())
|
||||||
subset;
|
subset;
|
||||||
let locnums = sort compare (map fst (list_of_hashtbl locnums)) in
|
let locnums = sort compare (map fst (list_of_hashtbl locnums)) in
|
||||||
@ -464,15 +464,9 @@ let write_font filename data =
|
|||||||
output_string fh (Pdfio.string_of_bytes data);
|
output_string fh (Pdfio.string_of_bytes data);
|
||||||
close_out fh
|
close_out fh
|
||||||
|
|
||||||
(* We don't really need this, but it makes debugging easier... *)
|
|
||||||
let partition_preserving_order p l =
|
|
||||||
let t, f = ref [], ref [] in
|
|
||||||
iter (fun x -> if p x then t := x::!t else f := x::!f) l;
|
|
||||||
rev !t, rev !f
|
|
||||||
|
|
||||||
let find_main encoding subset =
|
let find_main encoding subset =
|
||||||
let encoding_table = Pdftext.table_of_encoding encoding in
|
let encoding_table = Pdftext.table_of_encoding encoding in
|
||||||
partition_preserving_order
|
List.partition
|
||||||
(fun u -> try ignore (Hashtbl.find encoding_table u); true with Not_found -> false)
|
(fun u -> try ignore (Hashtbl.find encoding_table u); true with Not_found -> false)
|
||||||
subset
|
subset
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user