mirror of
				https://github.com/johnwhitington/cpdf-source.git
				synced 2025-06-05 22:09:39 +02:00 
			
		
		
		
	more
This commit is contained in:
		| @@ -34,12 +34,12 @@ let embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding = | |||||||
|   let name_1 = basename () in |   let name_1 = basename () in | ||||||
|   let module TT = Cpdftruetype in |   let module TT = Cpdftruetype in | ||||||
|   let fontfile = |   let fontfile = | ||||||
|     let len = Pdfio.bytes_size f.TT.subset in |     let len = Pdfio.bytes_size f.TT.subset_fontfile in | ||||||
|     Pdf.Stream |     Pdf.Stream | ||||||
|       {contents = |       {contents = | ||||||
|          (Pdf.Dictionary |          (Pdf.Dictionary | ||||||
|             [("/Length", Pdf.Integer len); ("/Length1", Pdf.Integer len)], |             [("/Length", Pdf.Integer len); ("/Length1", Pdf.Integer len)], | ||||||
|           Pdf.Got f.TT.subset)} |           Pdf.Got f.TT.subset_fontfile)} | ||||||
|   in |   in | ||||||
|   let fontfile_num = Pdf.addobj pdf fontfile in |   let fontfile_num = Pdf.addobj pdf fontfile in | ||||||
|   let open Pdftext in |   let open Pdftext in | ||||||
|   | |||||||
| @@ -19,7 +19,8 @@ type t = | |||||||
|    firstchar : int; |    firstchar : int; | ||||||
|    lastchar : int; |    lastchar : int; | ||||||
|    widths : int array; |    widths : int array; | ||||||
|    subset : Pdfio.bytes; |    subset_fontfile : Pdfio.bytes; | ||||||
|  |    subset : int list; | ||||||
|    tounicode : Pdfio.bytes option} |    tounicode : Pdfio.bytes option} | ||||||
|  |  | ||||||
| let dbg = ref false | let dbg = ref false | ||||||
| @@ -554,7 +555,11 @@ let parse ?(subset=[]) data encoding = | |||||||
|               | (_, _, o, l)::_ -> o, l |               | (_, _, o, l)::_ -> o, l | ||||||
|               | [] -> raise (Pdf.PDFError "No glyf table found in TrueType font") |               | [] -> raise (Pdf.PDFError "No glyf table found in TrueType font") | ||||||
|             in |             in | ||||||
|             let subset = remove_unneeded_tables major minor !tables indexToLocFormat subset encoding !glyphcodes loca mk_b glyfoffset data in |             let main_subset = remove_unneeded_tables major minor !tables indexToLocFormat (tl subset) encoding !glyphcodes loca mk_b glyfoffset data in | ||||||
|  |             let second_subset = remove_unneeded_tables major minor !tables indexToLocFormat [hd subset] encoding !glyphcodes loca mk_b glyfoffset data in | ||||||
|               [{flags; minx; miny; maxx; maxy; italicangle; ascent; descent; |               [{flags; minx; miny; maxx; maxy; italicangle; ascent; descent; | ||||||
|                 capheight; stemv; xheight; avgwidth; maxwidth; firstchar; lastchar; |                 capheight; stemv; xheight; avgwidth; maxwidth; firstchar; lastchar; | ||||||
|               widths; subset; tounicode = None}] |                 widths; subset_fontfile = main_subset; subset = tl subset; tounicode = None}; | ||||||
|  |                {flags; minx; miny; maxx; maxy; italicangle; ascent; descent; | ||||||
|  |                 capheight; stemv; xheight; avgwidth; maxwidth; firstchar; lastchar; | ||||||
|  |                 widths; subset_fontfile = second_subset; subset = [hd subset]; tounicode = None}] | ||||||
|   | |||||||
| @@ -18,7 +18,8 @@ type t = | |||||||
|    firstchar : int; |    firstchar : int; | ||||||
|    lastchar : int; |    lastchar : int; | ||||||
|    widths : int array; |    widths : int array; | ||||||
|    subset : Pdfio.bytes; |    subset_fontfile : Pdfio.bytes; | ||||||
|  |    subset : int list; | ||||||
|    tounicode : Pdfio.bytes option} |    tounicode : Pdfio.bytes option} | ||||||
|  |  | ||||||
| (* Parse the given TrueType font file. It will return one or more fonts. The | (* Parse the given TrueType font file. It will return one or more fonts. The | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user