feat: update to c3 0.8.2
This commit is contained in:
parent
64d168f53b
commit
fedf67ecfe
3 changed files with 10 additions and 23 deletions
58
schrift.c3i
Normal file
58
schrift.c3i
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
module schrift;
|
||||
|
||||
alias SftFont = void*;
|
||||
alias SftUChar = uint;
|
||||
alias SftGlyph = uint;
|
||||
|
||||
const int SFT_DOWNWARD_Y = 0x01;
|
||||
|
||||
struct Sft
|
||||
{
|
||||
SftFont font;
|
||||
double xScale;
|
||||
double yScale;
|
||||
double xOffset;
|
||||
double yOffset;
|
||||
int flags;
|
||||
}
|
||||
|
||||
struct SftLMetrics
|
||||
{
|
||||
double ascender;
|
||||
double descender;
|
||||
double lineGap;
|
||||
}
|
||||
|
||||
struct SftGMetrics
|
||||
{
|
||||
double advanceWidth;
|
||||
double leftSideBearing;
|
||||
int yOffset;
|
||||
int minWidth;
|
||||
int minHeight;
|
||||
}
|
||||
|
||||
struct SftKerning
|
||||
{
|
||||
double xShift;
|
||||
double yShift;
|
||||
}
|
||||
|
||||
struct SftImage
|
||||
{
|
||||
void *pixels;
|
||||
int width;
|
||||
int height;
|
||||
}
|
||||
|
||||
extern fn ZString sft_version() @cname("sft_version");
|
||||
|
||||
extern fn SftFont loadmem(void* mem, usz size) @cname("sft_loadmem");
|
||||
extern fn SftFont loadfile(ZString filename) @cname("sft_loadfile");
|
||||
extern fn void freefont(SftFont font) @cname("sft_freefont");
|
||||
|
||||
extern fn int lmetrics(Sft* sft, SftLMetrics* metrics) @cname("sft_lmetrics");
|
||||
extern fn int lookup(Sft* sft, SftUChar codepoint, SftGlyph* glyph) @cname("sft_lookup");
|
||||
extern fn int gmetrics(Sft* sft, SftGlyph glyph, SftGMetrics* metrics) @cname("sft_gmetrics");
|
||||
extern fn int kerning(Sft* sft, SftGlyph leftGlyph, SftGlyph rightGlyph, SftKerning* kerning) @cname("sft_kerning");
|
||||
extern fn int render(Sft* sft, SftGlyph glyph, SftImage image) @cname("sft_render");
|
||||
Loading…
Add table
Add a link
Reference in a new issue