diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/freetype.m | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'module/freetype.m')
| -rw-r--r-- | module/freetype.m | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/module/freetype.m b/module/freetype.m new file mode 100644 index 00000000..ce4d5c4b --- /dev/null +++ b/module/freetype.m @@ -0,0 +1,44 @@ +Freetype: module { + PATH: con "$Freetype"; + + Matrix: adt { + a, b: int; # 16.16 fixed-point coefficients + c, d: int; + }; + + Vector: adt { + dx: int; # 26.6 fixed-point deltas + dy: int; + }; + + STYLE_ITALIC, + STYLE_BOLD: con 1 << iota; + + Face: adt { + nfaces: int; + index: int; + style: int; # STYLE_xxx + height: int; + ascent: int; + familyname: string; + stylename: string; + + # pts - point size as a 26.6 fixed-point value + setcharsize: fn(face: self ref Face, pts, hdpi, vdpi: int): string; + settransform: fn(face: self ref Face, m: ref Matrix, v: ref Vector): string; + haschar: fn(face: self ref Face, c: int): int; + loadglyph: fn(face: self ref Face, c: int): ref Glyph; + }; + + Glyph: adt { + top: int; + left: int; + height: int; + width: int; + advance: Draw->Point; # 26.6 fixed-point + bitmap: array of byte; # (width*height) 8-bit greyscale + }; + + newface: fn(path: string, index: int): ref Face; + newmemface: fn(data: array of byte, index: int): ref Face; +}; |
