WIP: compiles but completely broken
AGG files imported from AGG repository, sdl-testing branch. the pixfmt_bgra32_lcd is just implemented and is not tested.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
stbtt_InitFont
|
||||
|
||||
stbtt_ScaleForMappingEmToPixels x 3
|
||||
stbtt_ScaleForPixelHeight
|
||||
stbtt_BakeFontBitmap
|
||||
stbtt_GetFontVMetrics x 2
|
||||
|
||||
struct RenImage {
|
||||
RenColor *pixels;
|
||||
int width, height;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
RenImage *image;
|
||||
stbtt_bakedchar glyphs[256];
|
||||
} GlyphSet;
|
||||
|
||||
struct RenFont {
|
||||
void *data;
|
||||
stbtt_fontinfo stbfont;
|
||||
GlyphSet *sets[MAX_GLYPHSET];
|
||||
float size;
|
||||
int height;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned short x0, y0, x1, y1; // coordinates of bbox in bitmap
|
||||
float xoff, yoff, xadvance;
|
||||
} stbtt_bakedchar;
|
||||
|
||||
The function stbtt_BakeFontBitmap is used to write bitmap data into set->image->pixels (where set is a GlyphSet).
|
||||
Note that set->image->pixels need data in RGB format. After stbtt_BakeFontBitmap call the bitmap data are converted into RGB.
|
||||
With a single call many glyphs corresponding to a range of codepoints, all in a
|
||||
single image.
|
||||
Reference in New Issue
Block a user