SHOW:
|
|
- or go back to the newest paste.
| 1 | - | let kerning = ref [] in |
| 1 | + | type font_layout_data = {
|
| 2 | - | match ctx.ttf.ttf_kern with |
| 2 | + | font_ascent: int; |
| 3 | - | |None -> (); |
| 3 | + | font_descent: int; |
| 4 | - | |Some(kern) -> |
| 4 | + | font_leading: int; |
| 5 | - | List.iter (fun t -> |
| 5 | + | font_glyphs_layout: font_layout_glyph_data array; |
| 6 | - | match t.ks_def with |
| 6 | + | font_kerning: font_kerning_data list; |
| 7 | - | | Kern0 (fmt) -> kerning := List.map(fun p -> |
| 7 | + | } |
| 8 | - | {
|
| 8 | + | |
| 9 | - | font_char_code1 = p.kern_left; |
| 9 | + | {
|
| 10 | - | font_char_code2 = p.kern_right; |
| 10 | + | font_ascent = snip |
| 11 | - | font_adjust = round((float_of_int p.kern_value) *. scale *. 20.) |
| 11 | + | font_descent = snip |
| 12 | - | })fmt.k0_pairs; |
| 12 | + | font_leading = snip |
| 13 | - | | Kern2 (fmt) -> (); |
| 13 | + | font_glyphs_layout = snip |
| 14 | - | )kern.kern_subtables; |
| 14 | + | font_kerning = !kerning; |
| 15 | } | |
| 16 | ||
| 17 | Error: This expression has type Swf.font_layout_data but is here used with type unit. |