mirror of
				https://github.com/johnwhitington/cpdf-source.git
				synced 2025-06-05 22:09:39 +02:00 
			
		
		
		
	fontpack arrives at addtext, save for ExistingNameFont
This commit is contained in:
		| @@ -231,7 +231,7 @@ let expand_lines text time pdf endpage extract_text_font_size filename bates bat | |||||||
|  |  | ||||||
| let addtext | let addtext | ||||||
|   time lines linewidth outline fast colour fontname encoding bates batespad |   time lines linewidth outline fast colour fontname encoding bates batespad | ||||||
|   fontsize font fontpdfobj underneath position hoffset voffset text pages |   fontsize fontpack font fontpdfobj underneath position hoffset voffset text pages | ||||||
|   cropbox opacity justification filename extract_text_font_size shift raw pdf |   cropbox opacity justification filename extract_text_font_size shift raw pdf | ||||||
| = | = | ||||||
|   let lines = map (fun text -> if raw then text else charcodes_of_utf8 (Pdftext.read_font pdf fontpdfobj) text) lines in |   let lines = map (fun text -> if raw then text else charcodes_of_utf8 (Pdftext.read_font pdf fontpdfobj) text) lines in | ||||||
| @@ -427,16 +427,16 @@ let | |||||||
|     pages |     pages | ||||||
|     (map (fun x -> List.nth ps (x - 1)) pages); |     (map (fun x -> List.nth ps (x - 1)) pages); | ||||||
|   let realfontname = ref fontname in |   let realfontname = ref fontname in | ||||||
|   let font = |   let font, fontpack = | ||||||
|     match cpdffont with |     match cpdffont with | ||||||
|     | Cpdfembed.PreMadeFontPack f -> |     | Cpdfembed.PreMadeFontPack f -> | ||||||
|         (*Printf.printf "Cpdfaddtext.addtexts: PreMadeFontPack\n";*) |         (*Printf.printf "Cpdfaddtext.addtexts: PreMadeFontPack\n";*) | ||||||
|         Some (hd (fst f)) |         Some (hd (fst f)), Some f | ||||||
|     | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> |     | Cpdfembed.EmbedInfo {fontfile; fontname; encoding} -> | ||||||
|         (*Printf.printf "Cpdfaddtext.addtexts: EmbedInfo\n";*) |         (*Printf.printf "Cpdfaddtext.addtexts: EmbedInfo\n";*) | ||||||
|         let embedded = Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:(map fst (list_of_hashtbl used)) ~encoding in |         let embedded = Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:(map fst (list_of_hashtbl used)) ~encoding in | ||||||
|           Some (hd (fst embedded)) |           Some (hd (fst embedded)), Some embedded  | ||||||
|     | Cpdfembed.ExistingNamedFont -> None |     | Cpdfembed.ExistingNamedFont -> None, None | ||||||
|   in |   in | ||||||
|   let fontpdfobj = |   let fontpdfobj = | ||||||
|     match font with |     match font with | ||||||
| @@ -518,7 +518,7 @@ let | |||||||
|                  let voff, hoff = !voffset, 0. in |                  let voff, hoff = !voffset, 0. in | ||||||
|                    pdf := |                    pdf := | ||||||
|                      addtext time lines linewidth outline fast colour !realfontname encoding |                      addtext time lines linewidth outline fast colour !realfontname encoding | ||||||
|                      bates batespad fontsize font fontpdfobj underneath position hoff voff line |                      bates batespad fontsize fontpack font fontpdfobj underneath position hoff voff line | ||||||
|                      pages cropbox opacity justification filename extract_text_font_size shift |                      pages cropbox opacity justification filename extract_text_font_size shift | ||||||
|                      raw !pdf; |                      raw !pdf; | ||||||
|                    voffset := !voffset +. (linespacing *. fontsize)) |                    voffset := !voffset +. (linespacing *. fontsize)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user