more
This commit is contained in:
parent
748939ae00
commit
4c467a896d
|
@ -21,7 +21,7 @@ type t =
|
||||||
widths : int array;
|
widths : int array;
|
||||||
subset : Pdfio.bytes}
|
subset : Pdfio.bytes}
|
||||||
|
|
||||||
let dbg = ref false (* text-based debug *)
|
let dbg = ref true (* text-based debug *)
|
||||||
|
|
||||||
(* 32-bit signed fixed-point number (16.16) returned as two ints *)
|
(* 32-bit signed fixed-point number (16.16) returned as two ints *)
|
||||||
let read_fixed b =
|
let read_fixed b =
|
||||||
|
@ -141,10 +141,10 @@ let read_loca_table indexToLocFormat numGlyphs b =
|
||||||
fix_empties arr; arr
|
fix_empties arr; arr
|
||||||
| _ -> raise (Pdf.PDFError "Unknown indexToLocFormat in read_loca_table")
|
| _ -> raise (Pdf.PDFError "Unknown indexToLocFormat in read_loca_table")
|
||||||
|
|
||||||
|
(* FIXME length checking *)
|
||||||
let read_os2_table b blength =
|
let read_os2_table b blength =
|
||||||
let version = read_ushort b in
|
let version = read_ushort b in
|
||||||
if !dbg then Printf.printf "OS/2 table blength = %i bytes, version number = %i\n" blength version;
|
if !dbg then Printf.printf "OS/2 table blength = %i bytes, version number = %i\n" blength version;
|
||||||
if version < 2 then failwith "read_os2_table: version number too low" else
|
|
||||||
let xAvgCharWidth = read_short b in
|
let xAvgCharWidth = read_short b in
|
||||||
discard_bytes b 64; (* discard 14 entries usWeightClass...fsLastCharIndex *)
|
discard_bytes b 64; (* discard 14 entries usWeightClass...fsLastCharIndex *)
|
||||||
(* -- end of original OS/2 Version 0 Truetype table. Must check length before reading now. *)
|
(* -- end of original OS/2 Version 0 Truetype table. Must check length before reading now. *)
|
||||||
|
@ -154,8 +154,8 @@ let read_os2_table b blength =
|
||||||
(* -- end of OpenType version 0 table *)
|
(* -- end of OpenType version 0 table *)
|
||||||
discard_bytes b 8; (* discard ulCodePageRange1, ulCodePageRange2 *)
|
discard_bytes b 8; (* discard ulCodePageRange1, ulCodePageRange2 *)
|
||||||
(* -- end of OpenType version 1 table *)
|
(* -- end of OpenType version 1 table *)
|
||||||
let sxHeight = read_short b in
|
let sxHeight = if version < 2 then 0 else read_short b in
|
||||||
let sCapHeight = read_short b in
|
let sCapHeight = if version < 2 then 0 else read_short b in
|
||||||
(sTypoAscender, sTypoDescender, sCapHeight, sxHeight, xAvgCharWidth)
|
(sTypoAscender, sTypoDescender, sCapHeight, sxHeight, xAvgCharWidth)
|
||||||
|
|
||||||
let read_post_table b =
|
let read_post_table b =
|
||||||
|
|
Loading…
Reference in New Issue