diff --git a/cpdfaddtext.ml b/cpdfaddtext.ml index 5812b9d..67dab6f 100644 --- a/cpdfaddtext.ml +++ b/cpdfaddtext.ml @@ -41,7 +41,7 @@ let width_of_text font text = match font with | Pdftext.SimpleFont {Pdftext.fontmetrics = Some fontmetrics} -> begin try - fold_left ( +. ) 0. (map (fun c -> fontmetrics.(int_of_char c)) (explode text)) + fsum (map (fun c -> fontmetrics.(int_of_char c)) (explode text)) with _ -> 0. end diff --git a/cpdfpng.ml b/cpdfpng.ml index edc3ade..b9f3702 100644 --- a/cpdfpng.ml +++ b/cpdfpng.ml @@ -35,7 +35,7 @@ let read_chunk i = (string_of_tag chunktype, chunkdata) let concat_bytes ss = - let total_length = fold_left ( + ) 0 (map bytes_size ss) in + let total_length = sum (map bytes_size ss) in let s' = mkbytes total_length in let p = ref 0 in iter