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