mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-02-19 13:20:49 +01:00
Beginning to reinstate kerning
This commit is contained in:
parent
0980928b77
commit
b224500cfc
15
cpdf.ml
15
cpdf.ml
@ -1661,6 +1661,10 @@ let make_font embed fontname =
|
|||||||
("/Encoding", Pdf.Name "/WinAnsiEncoding");
|
("/Encoding", Pdf.Name "/WinAnsiEncoding");
|
||||||
("/BaseFont", Pdf.Name ("/" ^ fontname))]
|
("/BaseFont", Pdf.Name ("/" ^ fontname))]
|
||||||
|
|
||||||
|
(* Convert text in winasciiencoding to standard encoding, so that
|
||||||
|
Pdfstandard14.textwidth works *)
|
||||||
|
let win_of_standard text = text
|
||||||
|
|
||||||
let addtext
|
let addtext
|
||||||
metrics lines linewidth outline fast colour fontname embed bates batespad fontsize font
|
metrics lines linewidth outline fast colour fontname embed bates batespad fontsize font
|
||||||
underneath position hoffset voffset text pages orientation cropbox opacity
|
underneath position hoffset voffset text pages orientation cropbox opacity
|
||||||
@ -1712,12 +1716,11 @@ let addtext
|
|||||||
let calc_textwidth text =
|
let calc_textwidth text =
|
||||||
match font with
|
match font with
|
||||||
| Some f ->
|
| Some f ->
|
||||||
(* FIXME This is a bit wrong in the prescence of special
|
let text =
|
||||||
characters due to standard encoding not win encoding being
|
if embed then win_of_standard text else text
|
||||||
used in textwidth. When we have new AFM parsing up and
|
in
|
||||||
running, can improve. *)
|
let rawwidth = Pdfstandard14.textwidth false f text in
|
||||||
let rawwidth = Pdfstandard14.textwidth false f text in
|
(float rawwidth *. fontsize) /. 1000.
|
||||||
(float rawwidth *. fontsize) /. 1000.
|
|
||||||
| None ->
|
| None ->
|
||||||
let font =
|
let font =
|
||||||
match Pdf.lookup_direct pdf "/Font" page.Pdfpage.resources with
|
match Pdf.lookup_direct pdf "/Font" page.Pdfpage.resources with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user