22#define FONS_INVALID -1
64 void (*
renderDraw)(
void* uptr,
const float* verts,
const float* tcoords,
const unsigned int* colors,
int nverts);
144#ifdef FONTSTASH_IMPLEMENTATION
146#define FONS_NOTUSED(v) (void)sizeof(v)
148#ifdef FONS_USE_FREETYPE
151#include FT_FREETYPE_H
152#include FT_ADVANCES_H
155struct FONSttFontImpl {
158typedef struct FONSttFontImpl FONSttFontImpl;
162#define STB_TRUETYPE_IMPLEMENTATION
163static void* fons__tmpalloc(
size_t size,
void* up);
164static void fons__tmpfree(
void* ptr,
void* up);
165#define STBTT_malloc(x,u) fons__tmpalloc(x,u)
166#define STBTT_free(x,u) fons__tmpfree(x,u)
169struct FONSttFontImpl {
172typedef struct FONSttFontImpl FONSttFontImpl;
176#ifndef FONS_SCRATCH_BUF_SIZE
177# define FONS_SCRATCH_BUF_SIZE 96000
179#ifndef FONS_HASH_LUT_SIZE
180# define FONS_HASH_LUT_SIZE 256
182#ifndef FONS_INIT_FONTS
183# define FONS_INIT_FONTS 4
185#ifndef FONS_INIT_GLYPHS
186# define FONS_INIT_GLYPHS 256
188#ifndef FONS_INIT_ATLAS_NODES
189# define FONS_INIT_ATLAS_NODES 256
191#ifndef FONS_VERTEX_COUNT
192# define FONS_VERTEX_COUNT 1024
194#ifndef FONS_MAX_STATES
195# define FONS_MAX_STATES 20
197#ifndef FONS_MAX_FALLBACKS
198# define FONS_MAX_FALLBACKS 20
201static unsigned int fons__hashint(
unsigned int a)
212static int fons__mini(
int a,
int b)
214 return a <
b ?
a :
b;
217static int fons__maxi(
int a,
int b)
219 return a >
b ?
a :
b;
224 unsigned int codepoint;
229 short xadv,xoff,yoff;
231typedef struct FONSglyph FONSglyph;
239 unsigned char freeData;
246 int lut[FONS_HASH_LUT_SIZE];
247 int fallbacks[FONS_MAX_FALLBACKS];
250typedef struct FONSfont FONSfont;
261typedef struct FONSstate FONSstate;
263struct FONSatlasNode {
266typedef struct FONSatlasNode FONSatlasNode;
271 FONSatlasNode* nodes;
275typedef struct FONSatlas FONSatlas;
281 unsigned char* texData;
287 float verts[FONS_VERTEX_COUNT*2];
288 float tcoords[FONS_VERTEX_COUNT*2];
289 unsigned int colors[FONS_VERTEX_COUNT];
291 unsigned char* scratch;
293 FONSstate states[FONS_MAX_STATES];
297#ifdef FONS_USE_FREETYPE
298 FT_Library ftLibrary;
302#ifdef FONS_USE_FREETYPE
307 ftError = FT_Init_FreeType(&context->ftLibrary);
314 ftError = FT_Done_FreeType(context->ftLibrary);
318int fons__tt_loadFont(
FONScontext *context, FONSttFontImpl *font,
unsigned char *
data,
int dataSize,
int fontIndex)
323 ftError = FT_New_Memory_Face(context->ftLibrary, (
const FT_Byte*)
data, dataSize, fontIndex, &font->font);
327void fons__tt_getFontVMetrics(FONSttFontImpl *font,
int *ascent,
int *descent,
int *lineGap)
329 *ascent = font->font->ascender;
330 *descent = font->font->descender;
331 *lineGap = font->font->height - (*ascent - *descent);
334float fons__tt_getPixelHeightScale(FONSttFontImpl *font,
float size)
338 return size / (font->font->ascender - font->font->descender);
340 return size / font->font->units_per_EM;
344int fons__tt_getGlyphIndex(FONSttFontImpl *font,
int codepoint)
346 return FT_Get_Char_Index(font->font, codepoint);
349int fons__tt_buildGlyphBitmap(FONSttFontImpl *font,
int glyph,
float size,
float scale,
350 int *advance,
int *lsb,
int *x0,
int *y0,
int *x1,
int *y1)
353 FT_GlyphSlot ftGlyph;
359 ftError = FT_Set_Pixel_Sizes(font->font, 0, (FT_UInt)(
size * (
float)font->font->units_per_EM / (
float)(font->font->ascender - font->font->descender)));
361 ftError = FT_Set_Pixel_Sizes(font->font, 0,
size);
363 if (ftError)
return 0;
366 ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER);
368 ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT);
370 if (ftError)
return 0;
371 ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed);
372 if (ftError)
return 0;
373 ftGlyph = font->font->glyph;
374 *advance = (
int)advFixed;
375 *lsb = (
int)ftGlyph->metrics.horiBearingX;
376 *x0 = ftGlyph->bitmap_left;
377 *x1 = *x0 + ftGlyph->bitmap.width;
378 *y0 = -ftGlyph->bitmap_top;
379 *y1 = *y0 + ftGlyph->bitmap.rows;
383void fons__tt_renderGlyphBitmap(FONSttFontImpl *font,
unsigned char *output,
int outWidth,
int outHeight,
int outStride,
384 float scaleX,
float scaleY,
int glyph)
386 FT_GlyphSlot ftGlyph = font->font->glyph;
387 int ftGlyphOffset = 0;
389 FONS_NOTUSED(outWidth);
390 FONS_NOTUSED(outHeight);
391 FONS_NOTUSED(scaleX);
392 FONS_NOTUSED(scaleY);
395 for (
y = 0;
y < ftGlyph->bitmap.rows;
y++ ) {
396 for (
x = 0;
x < ftGlyph->bitmap.width;
x++ ) {
397 output[(
y * outStride) +
x] = ftGlyph->bitmap.buffer[ftGlyphOffset++];
402int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font,
int glyph1,
int glyph2)
405 FT_Get_Kerning(font->font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning);
406 return (
int)((ftKerning.x + 32) >> 6);
413 FONS_NOTUSED(context);
419 FONS_NOTUSED(context);
423int fons__tt_loadFont(
FONScontext *context, FONSttFontImpl *font,
unsigned char *
data,
int dataSize,
int fontIndex)
425 int offset, stbError;
426 FONS_NOTUSED(dataSize);
428 font->font.userdata = context;
438void fons__tt_getFontVMetrics(FONSttFontImpl *font,
int *ascent,
int *descent,
int *lineGap)
443float fons__tt_getPixelHeightScale(FONSttFontImpl *font,
float size)
453int fons__tt_getGlyphIndex(FONSttFontImpl *font,
int codepoint)
458int fons__tt_buildGlyphBitmap(FONSttFontImpl *font,
int glyph,
float size,
float scale,
459 int *advance,
int *lsb,
int *x0,
int *y0,
int *x1,
int *y1)
467void fons__tt_renderGlyphBitmap(FONSttFontImpl *font,
unsigned char *output,
int outWidth,
int outHeight,
int outStride,
468 float scaleX,
float scaleY,
int glyph)
473int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font,
int glyph1,
int glyph2)
480#ifdef STB_TRUETYPE_IMPLEMENTATION
482static void* fons__tmpalloc(
size_t size,
void* up)
490 if (stash->nscratch+(
int)
size > FONS_SCRATCH_BUF_SIZE) {
491 if (stash->handleError)
495 ptr = stash->scratch + stash->nscratch;
500static void fons__tmpfree(
void* ptr,
void* up)
512#define FONS_UTF8_ACCEPT 0
513#define FONS_UTF8_REJECT 12
515static unsigned int fons__decutf8(
unsigned int* state,
unsigned int* codep,
unsigned int byte)
517 static const unsigned char utf8d[] = {
520 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
521 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
522 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
523 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
524 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
525 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
526 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
527 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
531 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
532 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
533 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
534 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
535 12,36,12,12,12,12,12,12,12,12,12,12,
540 *codep = (*state != FONS_UTF8_ACCEPT) ?
541 (
byte & 0x3fu) | (*codep << 6) :
544 *state = utf8d[256 + *state +
type];
550static void fons__deleteAtlas(FONSatlas* atlas)
552 if (atlas ==
NULL)
return;
553 if (atlas->nodes !=
NULL) free(atlas->nodes);
557static FONSatlas* fons__allocAtlas(
int w,
int h,
int nnodes)
559 FONSatlas* atlas =
NULL;
562 atlas = (FONSatlas*)
malloc(
sizeof(FONSatlas));
564 memset(atlas, 0,
sizeof(FONSatlas));
570 atlas->nodes = (FONSatlasNode*)
malloc(
sizeof(FONSatlasNode) * nnodes);
572 memset(atlas->nodes, 0,
sizeof(FONSatlasNode) * nnodes);
574 atlas->cnodes = nnodes;
577 atlas->nodes[0].x = 0;
578 atlas->nodes[0].y = 0;
579 atlas->nodes[0].width = (short)
w;
585 if (atlas) fons__deleteAtlas(atlas);
589static int fons__atlasInsertNode(FONSatlas* atlas,
int idx,
int x,
int y,
int w)
593 if (atlas->nnodes+1 > atlas->cnodes) {
594 atlas->cnodes = atlas->cnodes == 0 ? 8 : atlas->cnodes * 2;
595 atlas->nodes = (FONSatlasNode*)realloc(atlas->nodes,
sizeof(FONSatlasNode) * atlas->cnodes);
596 if (atlas->nodes ==
NULL)
599 for (
i = atlas->nnodes;
i > idx;
i--)
600 atlas->nodes[
i] = atlas->nodes[
i-1];
601 atlas->nodes[idx].x = (short)
x;
602 atlas->nodes[idx].y = (short)
y;
603 atlas->nodes[idx].width = (short)
w;
609static void fons__atlasRemoveNode(FONSatlas* atlas,
int idx)
612 if (atlas->nnodes == 0)
return;
613 for (
i = idx;
i < atlas->nnodes-1;
i++)
614 atlas->nodes[
i] = atlas->nodes[
i+1];
618static void fons__atlasExpand(FONSatlas* atlas,
int w,
int h)
621 if (
w > atlas->width)
622 fons__atlasInsertNode(atlas, atlas->nnodes, atlas->width, 0,
w - atlas->width);
627static void fons__atlasReset(FONSatlas* atlas,
int w,
int h)
634 atlas->nodes[0].x = 0;
635 atlas->nodes[0].y = 0;
636 atlas->nodes[0].width = (short)
w;
640static int fons__atlasAddSkylineLevel(FONSatlas* atlas,
int idx,
int x,
int y,
int w,
int h)
645 if (fons__atlasInsertNode(atlas, idx,
x,
y+
h,
w) == 0)
649 for (
i = idx+1;
i < atlas->nnodes;
i++) {
650 if (atlas->nodes[
i].x < atlas->nodes[
i-1].x + atlas->nodes[
i-1].width) {
651 int shrink = atlas->nodes[
i-1].x + atlas->nodes[
i-1].width - atlas->nodes[
i].x;
652 atlas->nodes[
i].x += (short)shrink;
653 atlas->nodes[
i].width -= (short)shrink;
654 if (atlas->nodes[
i].width <= 0) {
655 fons__atlasRemoveNode(atlas,
i);
666 for (
i = 0;
i < atlas->nnodes-1;
i++) {
667 if (atlas->nodes[
i].y == atlas->nodes[
i+1].y) {
668 atlas->nodes[
i].width += atlas->nodes[
i+1].width;
669 fons__atlasRemoveNode(atlas,
i+1);
677static int fons__atlasRectFits(FONSatlas* atlas,
int i,
int w,
int h)
682 int x = atlas->nodes[
i].x;
683 int y = atlas->nodes[
i].y;
685 if (
x +
w > atlas->width)
688 while (spaceLeft > 0) {
689 if (
i == atlas->nnodes)
return -1;
690 y = fons__maxi(
y, atlas->nodes[
i].y);
691 if (
y +
h > atlas->height)
return -1;
692 spaceLeft -= atlas->nodes[
i].width;
698static int fons__atlasAddRect(FONSatlas* atlas,
int rw,
int rh,
int* rx,
int* ry)
700 int besth = atlas->height, bestw = atlas->width, besti = -1;
701 int bestx = -1, besty = -1,
i;
704 for (
i = 0;
i < atlas->nnodes;
i++) {
705 int y = fons__atlasRectFits(atlas,
i, rw, rh);
707 if (
y + rh < besth || (
y + rh == besth && atlas->nodes[
i].width < bestw)) {
709 bestw = atlas->nodes[
i].width;
711 bestx = atlas->nodes[
i].x;
721 if (fons__atlasAddSkylineLevel(atlas, besti, bestx, besty, rw, rh) == 0)
730static void fons__addWhiteRect(
FONScontext* stash,
int w,
int h)
734 if (fons__atlasAddRect(stash->atlas,
w,
h, &gx, &gy) == 0)
738 dst = &stash->texData[gx + gy * stash->params.width];
739 for (
y = 0;
y <
h;
y++) {
740 for (
x = 0;
x <
w;
x++)
742 dst += stash->params.width;
745 stash->dirtyRect[0] = fons__mini(stash->dirtyRect[0], gx);
746 stash->dirtyRect[1] = fons__mini(stash->dirtyRect[1], gy);
747 stash->dirtyRect[2] = fons__maxi(stash->dirtyRect[2], gx+
w);
748 stash->dirtyRect[3] = fons__maxi(stash->dirtyRect[3], gy+
h);
760 stash->params = *params;
763 stash->scratch = (
unsigned char*)
malloc(FONS_SCRATCH_BUF_SIZE);
767 if (!fons__tt_init(stash))
goto error;
769 if (stash->params.renderCreate !=
NULL) {
770 if (stash->params.renderCreate(stash->params.userPtr, stash->params.width, stash->params.height) == 0)
774 stash->atlas = fons__allocAtlas(stash->params.width, stash->params.height, FONS_INIT_ATLAS_NODES);
778 stash->fonts = (FONSfont**)
malloc(
sizeof(FONSfont*) * FONS_INIT_FONTS);
780 memset(stash->fonts, 0,
sizeof(FONSfont*) * FONS_INIT_FONTS);
781 stash->cfonts = FONS_INIT_FONTS;
785 stash->itw = 1.0f/stash->params.width;
786 stash->ith = 1.0f/stash->params.height;
787 stash->texData = (
unsigned char*)
malloc(stash->params.width * stash->params.height);
789 memset(stash->texData, 0, stash->params.width * stash->params.height);
791 stash->dirtyRect[0] = stash->params.width;
792 stash->dirtyRect[1] = stash->params.height;
793 stash->dirtyRect[2] = 0;
794 stash->dirtyRect[3] = 0;
797 fons__addWhiteRect(stash, 2,2);
809static FONSstate* fons__getState(
FONScontext* stash)
811 return &stash->states[stash->nstates-1];
814int fonsAddFallbackFont(
FONScontext* stash,
int base,
int fallback)
816 FONSfont* baseFont = stash->fonts[base];
817 if (baseFont->nfallbacks < FONS_MAX_FALLBACKS) {
818 baseFont->fallbacks[baseFont->nfallbacks++] = fallback;
824void fonsResetFallbackFont(
FONScontext* stash,
int base)
828 FONSfont* baseFont = stash->fonts[base];
829 baseFont->nfallbacks = 0;
830 baseFont->nglyphs = 0;
831 for (
i = 0;
i < FONS_HASH_LUT_SIZE;
i++)
832 baseFont->lut[
i] = -1;
837 fons__getState(stash)->size =
size;
842 fons__getState(stash)->color = color;
847 fons__getState(stash)->spacing = spacing;
852 fons__getState(stash)->blur = blur;
857 fons__getState(stash)->align = align;
862 fons__getState(stash)->font = font;
867 if (stash->nstates >= FONS_MAX_STATES) {
868 if (stash->handleError)
872 if (stash->nstates > 0)
873 memcpy(&stash->states[stash->nstates], &stash->states[stash->nstates-1],
sizeof(FONSstate));
879 if (stash->nstates <= 1) {
880 if (stash->handleError)
889 FONSstate* state = fons__getState(stash);
891 state->color = 0xffffffff;
898static void fons__freeFont(FONSfont* font)
900 if (font ==
NULL)
return;
901 if (font->glyphs) free(font->glyphs);
902 if (font->freeData && font->data) free(font->data);
908 FONSfont* font =
NULL;
909 if (stash->nfonts+1 > stash->cfonts) {
910 stash->cfonts = stash->cfonts == 0 ? 8 : stash->cfonts * 2;
911 stash->fonts = (FONSfont**)realloc(stash->fonts,
sizeof(FONSfont*) * stash->cfonts);
912 if (stash->fonts ==
NULL)
915 stash->fonts[
i] =
NULL;
917 font = (FONSfont*)
malloc(
sizeof(FONSfont));
919 memset(font, 0,
sizeof(FONSfont));
921 font->glyphs = (FONSglyph*)
malloc(
sizeof(FONSglyph) * FONS_INIT_GLYPHS);
923 font->cglyphs = FONS_INIT_GLYPHS;
926 stash->fonts[stash->nfonts++] = font;
927 return stash->nfonts-1;
930 fons__freeFont(font);
943 fp = fopen(path,
"rb");
946 dataSize = (
int)ftell(fp);
950 readed = fread(
data, 1, dataSize, fp);
953 if (readed != (
size_t)dataSize)
goto error;
965 int i, ascent, descent, fh, lineGap;
968 int idx = fons__allocFont(stash);
975 font = stash->fonts[idx];
977 strncpy(font->name,
name,
sizeof(font->name));
978 font->name[
sizeof(font->name)-1] =
'\0';
981 for (
i = 0;
i < FONS_HASH_LUT_SIZE; ++
i)
985 font->dataSize = dataSize;
987 font->freeData = (
unsigned char)freeData;
991 if (!fons__tt_loadFont(stash, &font->font,
data, dataSize, fontIndex))
goto error;
995 fons__tt_getFontVMetrics( &font->font, &ascent, &descent, &lineGap);
997 fh = ascent - descent;
998 font->ascender = (float)ascent / (
float)fh;
999 font->descender = (float)descent / (
float)fh;
1000 font->lineh = font->ascender - font->descender;
1005 fons__freeFont(font);
1013 for (
i = 0;
i <
s->nfonts;
i++) {
1014 if (strcmp(
s->fonts[
i]->name,
name) == 0)
1021static FONSglyph* fons__allocGlyph(FONSfont* font)
1023 if (font->nglyphs+1 > font->cglyphs) {
1024 font->cglyphs = font->cglyphs == 0 ? 8 : font->cglyphs * 2;
1025 font->glyphs = (FONSglyph*)realloc(font->glyphs,
sizeof(FONSglyph) * font->cglyphs);
1026 if (font->glyphs ==
NULL)
return NULL;
1027 for (
int i=font->nglyphs;
i<font->cglyphs; ++
i)
1028 memset(&font->glyphs[
i], 0,
sizeof(*font->glyphs));
1031 return &font->glyphs[font->nglyphs-1];
1040static void fons__blurCols(
unsigned char* dst,
int w,
int h,
int dstStride,
int alpha)
1043 for (
y = 0;
y <
h;
y++) {
1045 for (
x = 1;
x <
w;
x++) {
1046 z += (alpha * (((
int)(dst[
x]) << ZPREC) -
z)) >> APREC;
1047 dst[
x] = (
unsigned char)(
z >> ZPREC);
1051 for (
x =
w-2;
x >= 0;
x--) {
1052 z += (alpha * (((
int)(dst[
x]) << ZPREC) -
z)) >> APREC;
1053 dst[
x] = (
unsigned char)(
z >> ZPREC);
1060static void fons__blurRows(
unsigned char* dst,
int w,
int h,
int dstStride,
int alpha)
1063 for (
x = 0;
x <
w;
x++) {
1065 for (
y = dstStride;
y <
h*dstStride;
y += dstStride) {
1066 z += (alpha * (((
int)(dst[
y]) << ZPREC) -
z)) >> APREC;
1067 dst[
y] = (
unsigned char)(
z >> ZPREC);
1069 dst[(
h-1)*dstStride] = 0;
1071 for (
y = (
h-2)*dstStride;
y >= 0;
y -= dstStride) {
1072 z += (alpha * (((
int)(dst[
y]) << ZPREC) -
z)) >> APREC;
1073 dst[
y] = (
unsigned char)(
z >> ZPREC);
1081static void fons__blur(
FONScontext* stash,
unsigned char* dst,
int w,
int h,
int dstStride,
int blur)
1090 sigma = (float)blur * 0.57735f;
1091 alpha = (
int)((1<<APREC) * (1.0f - expf(-2.3f / (sigma+1.0f))));
1092 fons__blurRows(dst,
w,
h, dstStride, alpha);
1093 fons__blurCols(dst,
w,
h, dstStride, alpha);
1094 fons__blurRows(dst,
w,
h, dstStride, alpha);
1095 fons__blurCols(dst,
w,
h, dstStride, alpha);
1100static FONSglyph* fons__getGlyph(
FONScontext* stash, FONSfont* font,
unsigned int codepoint,
1101 short isize,
short iblur,
int bitmapOption)
1103 int i,
g, advance, lsb, x0, y0, x1, y1, gw, gh, gx, gy,
x,
y;
1105 FONSglyph* glyph =
NULL;
1107 float size = isize/10.0f;
1109 unsigned char* bdst;
1111 FONSfont* renderFont = font;
1113 if (isize < 2)
return NULL;
1114 if (iblur > 20) iblur = 20;
1118 stash->nscratch = 0;
1121 h = fons__hashint(codepoint) & (FONS_HASH_LUT_SIZE-1);
1124 if (font->glyphs[
i].codepoint == codepoint && font->glyphs[
i].size == isize && font->glyphs[
i].blur == iblur) {
1125 glyph = &font->glyphs[
i];
1132 i = font->glyphs[
i].next;
1136 g = fons__tt_getGlyphIndex(&font->font, codepoint);
1139 for (
i = 0;
i < font->nfallbacks; ++
i) {
1141 int fallbackIndex = fons__tt_getGlyphIndex(&
fallbackFont->font, codepoint);
1142 if (fallbackIndex != 0) {
1151 scale = fons__tt_getPixelHeightScale(&renderFont->font,
size);
1152 fons__tt_buildGlyphBitmap(&renderFont->font,
g,
size, scale, &advance, &lsb, &x0, &y0, &x1, &y1);
1159 added = fons__atlasAddRect(stash->atlas, gw, gh, &gx, &gy);
1160 if (added == 0 && stash->handleError !=
NULL) {
1163 added = fons__atlasAddRect(stash->atlas, gw, gh, &gx, &gy);
1165 if (added == 0)
return NULL;
1173 if (glyph ==
NULL) {
1174 glyph = fons__allocGlyph(font);
1175 glyph->codepoint = codepoint;
1176 glyph->size = isize;
1177 glyph->blur = iblur;
1181 glyph->next = font->lut[
h];
1182 font->lut[
h] = font->nglyphs-1;
1185 glyph->x0 = (short)gx;
1186 glyph->y0 = (short)gy;
1187 glyph->x1 = (short)(glyph->x0+gw);
1188 glyph->y1 = (short)(glyph->y0+gh);
1189 glyph->xadv = (short)(scale * advance * 10.0f);
1190 glyph->xoff = (short)(x0 - pad);
1191 glyph->yoff = (short)(y0 - pad);
1198 dst = &stash->texData[(glyph->x0+pad) + (glyph->y0+pad) * stash->params.width];
1199 fons__tt_renderGlyphBitmap(&renderFont->font, dst, gw-pad*2,gh-pad*2, stash->params.width, scale, scale,
g);
1202 dst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width];
1203 for (
y = 0;
y < gh;
y++) {
1204 dst[
y*stash->params.width] = 0;
1205 dst[gw-1 +
y*stash->params.width] = 0;
1207 for (
x = 0;
x < gw;
x++) {
1209 dst[
x + (gh-1)*stash->params.width] = 0;
1224 stash->nscratch = 0;
1225 bdst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width];
1226 fons__blur(stash, bdst, gw, gh, stash->params.width, iblur);
1229 stash->dirtyRect[0] = fons__mini(stash->dirtyRect[0], glyph->x0);
1230 stash->dirtyRect[1] = fons__mini(stash->dirtyRect[1], glyph->y0);
1231 stash->dirtyRect[2] = fons__maxi(stash->dirtyRect[2], glyph->x1);
1232 stash->dirtyRect[3] = fons__maxi(stash->dirtyRect[3], glyph->y1);
1237static void fons__getQuad(
FONScontext* stash, FONSfont* font,
1238 int prevGlyphIndex, FONSglyph* glyph,
1239 float scale,
float spacing,
float*
x,
float*
y,
FONSquad*
q)
1241 float rx,ry,xoff,yoff,x0,y0,x1,y1;
1243 if (prevGlyphIndex != -1) {
1244 float adv = fons__tt_getGlyphKernAdvance(&font->font, prevGlyphIndex, glyph->index) * scale;
1245 *
x += (
int)(adv + spacing + 0.5f);
1251 xoff = (short)(glyph->xoff+1);
1252 yoff = (short)(glyph->yoff+1);
1253 x0 = (float)(glyph->x0+1);
1254 y0 = (float)(glyph->y0+1);
1255 x1 = (float)(glyph->x1-1);
1256 y1 = (float)(glyph->y1-1);
1259 rx = floorf(*
x + xoff);
1260 ry = floorf(*
y + yoff);
1264 q->x1 = rx + x1 - x0;
1265 q->y1 = ry + y1 - y0;
1267 q->s0 = x0 * stash->itw;
1268 q->t0 = y0 * stash->ith;
1269 q->s1 = x1 * stash->itw;
1270 q->t1 = y1 * stash->ith;
1272 rx = floorf(*
x + xoff);
1273 ry = floorf(*
y - yoff);
1277 q->x1 = rx + x1 - x0;
1278 q->y1 = ry - y1 + y0;
1280 q->s0 = x0 * stash->itw;
1281 q->t0 = y0 * stash->ith;
1282 q->s1 = x1 * stash->itw;
1283 q->t1 = y1 * stash->ith;
1286 *
x += (
int)(glyph->xadv / 10.0f + 0.5f);
1292 if (stash->dirtyRect[0] < stash->dirtyRect[2] && stash->dirtyRect[1] < stash->dirtyRect[3]) {
1293 if (stash->params.renderUpdate !=
NULL)
1294 stash->params.renderUpdate(stash->params.userPtr, stash->dirtyRect, stash->texData);
1296 stash->dirtyRect[0] = stash->params.width;
1297 stash->dirtyRect[1] = stash->params.height;
1298 stash->dirtyRect[2] = 0;
1299 stash->dirtyRect[3] = 0;
1303 if (stash->nverts > 0) {
1304 if (stash->params.renderDraw !=
NULL)
1305 stash->params.renderDraw(stash->params.userPtr, stash->verts, stash->tcoords, stash->colors, stash->nverts);
1310static __inline
void fons__vertex(
FONScontext* stash,
float x,
float y,
float s,
float t,
unsigned int c)
1312 stash->verts[stash->nverts*2+0] =
x;
1313 stash->verts[stash->nverts*2+1] =
y;
1314 stash->tcoords[stash->nverts*2+0] =
s;
1315 stash->tcoords[stash->nverts*2+1] =
t;
1316 stash->colors[stash->nverts] =
c;
1320static float fons__getVertAlign(
FONScontext* stash, FONSfont* font,
int align,
short isize)
1324 return font->ascender * (float)isize/10.0f;
1326 return (font->ascender + font->descender) / 2.0f * (float)isize/10.0f;
1330 return font->descender * (float)isize/10.0f;
1334 return -font->ascender * (float)isize/10.0f;
1336 return -(font->ascender + font->descender) / 2.0f * (
float)isize/10.0f;
1340 return -font->descender * (float)isize/10.0f;
1348 const char* str,
const char* end)
1350 FONSstate* state = fons__getState(stash);
1351 unsigned int codepoint;
1352 unsigned int utf8state = 0;
1353 FONSglyph* glyph =
NULL;
1355 int prevGlyphIndex = -1;
1356 short isize = (short)(state->size*10.0f);
1357 short iblur = (short)state->blur;
1362 if (stash ==
NULL)
return x;
1363 if (state->font < 0 || state->font >= stash->nfonts)
return x;
1364 font = stash->fonts[state->font];
1365 if (font->data ==
NULL)
return x;
1367 scale = fons__tt_getPixelHeightScale(&font->font, (
float)isize/10.0f);
1370 end = str + strlen(str);
1383 y += fons__getVertAlign(stash, font, state->align, isize);
1385 for (; str !=
end; ++str) {
1386 if (fons__decutf8(&utf8state, &codepoint, *(
const unsigned char*)str))
1389 if (glyph !=
NULL) {
1390 fons__getQuad(stash, font, prevGlyphIndex, glyph, scale, state->spacing, &
x, &
y, &
q);
1392 if (stash->nverts+6 > FONS_VERTEX_COUNT)
1395 fons__vertex(stash,
q.x0,
q.y0,
q.s0,
q.t0, state->color);
1396 fons__vertex(stash,
q.x1,
q.y1,
q.s1,
q.t1, state->color);
1397 fons__vertex(stash,
q.x1,
q.y0,
q.s1,
q.t0, state->color);
1399 fons__vertex(stash,
q.x0,
q.y0,
q.s0,
q.t0, state->color);
1400 fons__vertex(stash,
q.x0,
q.y1,
q.s0,
q.t1, state->color);
1401 fons__vertex(stash,
q.x1,
q.y1,
q.s1,
q.t1, state->color);
1403 prevGlyphIndex = glyph !=
NULL ? glyph->index : -1;
1411 float x,
float y,
const char* str,
const char* end,
int bitmapOption)
1413 FONSstate* state = fons__getState(stash);
1416 memset(iter, 0,
sizeof(*iter));
1418 if (stash ==
NULL)
return 0;
1419 if (state->font < 0 || state->font >= stash->nfonts)
return 0;
1420 iter->
font = stash->fonts[state->font];
1421 if (iter->
font->data ==
NULL)
return 0;
1423 iter->
isize = (short)(state->size*10.0f);
1424 iter->
iblur = (short)state->blur;
1425 iter->
scale = fons__tt_getPixelHeightScale(&iter->
font->font, (
float)iter->
isize/10.0f);
1438 y += fons__getVertAlign(stash, iter->
font, state->align, iter->
isize);
1441 end = str + strlen(str);
1445 iter->
spacing = state->spacing;
1458 FONSglyph* glyph =
NULL;
1459 const char* str = iter->
next;
1462 if (str == iter->
end)
1465 for (; str != iter->
end; str++) {
1487 int w = stash->params.width;
1488 int h = stash->params.height;
1489 float u =
w == 0 ? 0 : (1.0f /
w);
1490 float v =
h == 0 ? 0 : (1.0f /
h);
1492 if (stash->nverts+6+6 > FONS_VERTEX_COUNT)
1496 fons__vertex(stash,
x+0,
y+0,
u,
v, 0x0fffffff);
1497 fons__vertex(stash,
x+
w,
y+
h,
u,
v, 0x0fffffff);
1498 fons__vertex(stash,
x+
w,
y+0,
u,
v, 0x0fffffff);
1500 fons__vertex(stash,
x+0,
y+0,
u,
v, 0x0fffffff);
1501 fons__vertex(stash,
x+0,
y+
h,
u,
v, 0x0fffffff);
1502 fons__vertex(stash,
x+
w,
y+
h,
u,
v, 0x0fffffff);
1505 fons__vertex(stash,
x+0,
y+0, 0, 0, 0xffffffff);
1506 fons__vertex(stash,
x+
w,
y+
h, 1, 1, 0xffffffff);
1507 fons__vertex(stash,
x+
w,
y+0, 1, 0, 0xffffffff);
1509 fons__vertex(stash,
x+0,
y+0, 0, 0, 0xffffffff);
1510 fons__vertex(stash,
x+0,
y+
h, 0, 1, 0xffffffff);
1511 fons__vertex(stash,
x+
w,
y+
h, 1, 1, 0xffffffff);
1514 for (
i = 0;
i < stash->atlas->nnodes;
i++) {
1515 FONSatlasNode*
n = &stash->atlas->nodes[
i];
1517 if (stash->nverts+6 > FONS_VERTEX_COUNT)
1520 fons__vertex(stash,
x+
n->x+0,
y+
n->y+0,
u,
v, 0xc00000ff);
1521 fons__vertex(stash,
x+
n->x+
n->width,
y+
n->y+1,
u,
v, 0xc00000ff);
1522 fons__vertex(stash,
x+
n->x+
n->width,
y+
n->y+0,
u,
v, 0xc00000ff);
1524 fons__vertex(stash,
x+
n->x+0,
y+
n->y+0,
u,
v, 0xc00000ff);
1525 fons__vertex(stash,
x+
n->x+0,
y+
n->y+1,
u,
v, 0xc00000ff);
1526 fons__vertex(stash,
x+
n->x+
n->width,
y+
n->y+1,
u,
v, 0xc00000ff);
1534 const char* str,
const char* end,
1537 FONSstate* state = fons__getState(stash);
1538 unsigned int codepoint;
1539 unsigned int utf8state = 0;
1541 FONSglyph* glyph =
NULL;
1542 int prevGlyphIndex = -1;
1543 short isize = (short)(state->size*10.0f);
1544 short iblur = (short)state->blur;
1547 float startx, advance;
1548 float minx, miny, maxx, maxy;
1550 if (stash ==
NULL)
return 0;
1551 if (state->font < 0 || state->font >= stash->nfonts)
return 0;
1552 font = stash->fonts[state->font];
1553 if (font->data ==
NULL)
return 0;
1555 scale = fons__tt_getPixelHeightScale(&font->font, (
float)isize/10.0f);
1558 y += fons__getVertAlign(stash, font, state->align, isize);
1565 end = str + strlen(str);
1567 for (; str !=
end; ++str) {
1568 if (fons__decutf8(&utf8state, &codepoint, *(
const unsigned char*)str))
1571 if (glyph !=
NULL) {
1572 fons__getQuad(stash, font, prevGlyphIndex, glyph, scale, state->spacing, &
x, &
y, &
q);
1573 if (
q.x0 < minx) minx =
q.x0;
1574 if (
q.x1 > maxx) maxx =
q.x1;
1576 if (
q.y0 < miny) miny =
q.y0;
1577 if (
q.y1 > maxy) maxy =
q.y1;
1579 if (
q.y1 < miny) miny =
q.y1;
1580 if (
q.y0 > maxy) maxy =
q.y0;
1583 prevGlyphIndex = glyph !=
NULL ? glyph->index : -1;
1586 advance =
x - startx;
1595 minx -= advance * 0.5f;
1596 maxx -= advance * 0.5f;
1610 float* ascender,
float* descender,
float* lineh)
1613 FONSstate* state = fons__getState(stash);
1616 if (stash ==
NULL)
return;
1617 if (state->font < 0 || state->font >= stash->nfonts)
return;
1618 font = stash->fonts[state->font];
1619 isize = (short)(state->size*10.0f);
1620 if (font->data ==
NULL)
return;
1623 *ascender = font->ascender*isize/10.0f;
1625 *descender = font->descender*isize/10.0f;
1627 *lineh = font->lineh*isize/10.0f;
1633 FONSstate* state = fons__getState(stash);
1636 if (stash ==
NULL)
return;
1637 if (state->font < 0 || state->font >= stash->nfonts)
return;
1638 font = stash->fonts[state->font];
1639 isize = (short)(state->size*10.0f);
1640 if (font->data ==
NULL)
return;
1642 y += fons__getVertAlign(stash, font, state->align, isize);
1645 *miny =
y - font->ascender * (float)isize/10.0f;
1646 *maxy = *miny + font->lineh*isize/10.0f;
1648 *maxy =
y + font->descender * (float)isize/10.0f;
1649 *miny = *maxy - font->lineh*isize/10.0f;
1656 *
width = stash->params.width;
1658 *
height = stash->params.height;
1659 return stash->texData;
1664 if (stash->dirtyRect[0] < stash->dirtyRect[2] && stash->dirtyRect[1] < stash->dirtyRect[3]) {
1665 dirty[0] = stash->dirtyRect[0];
1666 dirty[1] = stash->dirtyRect[1];
1667 dirty[2] = stash->dirtyRect[2];
1668 dirty[3] = stash->dirtyRect[3];
1670 stash->dirtyRect[0] = stash->params.width;
1671 stash->dirtyRect[1] = stash->params.height;
1672 stash->dirtyRect[2] = 0;
1673 stash->dirtyRect[3] = 0;
1682 if (stash ==
NULL)
return;
1684 if (stash->params.renderDelete)
1685 stash->params.renderDelete(stash->params.userPtr);
1687 for (
i = 0;
i < stash->nfonts; ++
i)
1688 fons__freeFont(stash->fonts[
i]);
1690 if (stash->atlas) fons__deleteAtlas(stash->atlas);
1691 if (stash->fonts) free(stash->fonts);
1692 if (stash->texData) free(stash->texData);
1693 if (stash->scratch) free(stash->scratch);
1694 fons__tt_done(stash);
1700 if (stash ==
NULL)
return;
1702 stash->errorUptr = uptr;
1707 if (stash ==
NULL)
return;
1708 *
width = stash->params.width;
1709 *
height = stash->params.height;
1716 if (stash ==
NULL)
return 0;
1718 width = fons__maxi(
width, stash->params.width);
1721 if (
width == stash->params.width &&
height == stash->params.height)
1728 if (stash->params.renderResize !=
NULL) {
1729 if (stash->params.renderResize(stash->params.userPtr,
width,
height) == 0)
1736 for (
i = 0;
i < stash->params.height;
i++) {
1738 unsigned char* src = &stash->texData[
i*stash->params.width];
1739 memcpy(dst, src, stash->params.width);
1740 if (
width > stash->params.width)
1741 memset(dst+stash->params.width, 0,
width - stash->params.width);
1743 if (
height > stash->params.height)
1746 free(stash->texData);
1747 stash->texData =
data;
1753 for (
i = 0;
i < stash->atlas->nnodes;
i++)
1754 maxy = fons__maxi(maxy, stash->atlas->nodes[
i].y);
1755 stash->dirtyRect[0] = 0;
1756 stash->dirtyRect[1] = 0;
1757 stash->dirtyRect[2] = stash->params.width;
1758 stash->dirtyRect[3] = maxy;
1760 stash->params.width =
width;
1761 stash->params.height =
height;
1762 stash->itw = 1.0f/stash->params.width;
1763 stash->ith = 1.0f/stash->params.height;
1771 if (stash ==
NULL)
return 0;
1777 if (stash->params.renderResize !=
NULL) {
1778 if (stash->params.renderResize(stash->params.userPtr,
width,
height) == 0)
1786 stash->texData = (
unsigned char*)realloc(stash->texData,
width *
height);
1787 if (stash->texData ==
NULL)
return 0;
1791 stash->dirtyRect[0] =
width;
1792 stash->dirtyRect[1] =
height;
1793 stash->dirtyRect[2] = 0;
1794 stash->dirtyRect[3] = 0;
1797 for (
i = 0;
i < stash->nfonts;
i++) {
1798 FONSfont* font = stash->fonts[
i];
1800 for (
j = 0;
j < FONS_HASH_LUT_SIZE;
j++)
1804 stash->params.width =
width;
1805 stash->params.height =
height;
1806 stash->itw = 1.0f/stash->params.width;
1807 stash->ith = 1.0f/stash->params.height;
1810 fons__addWhiteRect(stash, 2,2);
uint8_t a
Definition Spc_Cpu.h:141
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
#define byte
Definition blargg_source.h:87
UINT_D64 w
Definition inflate.c:942
unsigned z
Definition inflate.c:1589
struct huft * t
Definition inflate.c:943
register unsigned j
Definition inflate.c:1576
int y
Definition inflate.c:1588
unsigned v[N_MAX]
Definition inflate.c:1584
int g
Definition inflate.c:1573
struct huft * u[BMAX]
Definition inflate.c:1583
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
FONSerrorCode
Definition fontstash.h:46
@ FONS_STATES_OVERFLOW
Definition fontstash.h:52
@ FONS_SCRATCH_FULL
Definition fontstash.h:50
@ FONS_STATES_UNDERFLOW
Definition fontstash.h:54
@ FONS_ATLAS_FULL
Definition fontstash.h:48
int fonsGetFontByName(FONScontext *s, const char *name)
FONSflags
Definition fontstash.h:24
@ FONS_ZERO_BOTTOMLEFT
Definition fontstash.h:26
@ FONS_ZERO_TOPLEFT
Definition fontstash.h:25
int fonsValidateTexture(FONScontext *s, int *dirty)
void fonsLineBounds(FONScontext *s, float y, float *miny, float *maxy)
void fonsSetAlign(FONScontext *s, int align)
void fonsSetSpacing(FONScontext *s, float spacing)
void fonsDrawDebug(FONScontext *s, float x, float y)
int fonsAddFontMem(FONScontext *s, const char *name, unsigned char *data, int ndata, int freeData, int fontIndex)
int fonsExpandAtlas(FONScontext *s, int width, int height)
struct FONSparams FONSparams
Definition fontstash.h:67
void fonsGetAtlasSize(FONScontext *s, int *width, int *height)
int fonsTextIterInit(FONScontext *stash, FONStextIter *iter, float x, float y, const char *str, const char *end, int bitmapOption)
int fonsTextIterNext(FONScontext *stash, FONStextIter *iter, struct FONSquad *quad)
void fonsVertMetrics(FONScontext *s, float *ascender, float *descender, float *lineh)
void fonsSetBlur(FONScontext *s, float blur)
float fonsTextBounds(FONScontext *s, float x, float y, const char *string, const char *end, float *bounds)
void fonsPopState(FONScontext *s)
void fonsSetColor(FONScontext *s, unsigned int color)
FONSglyphBitmap
Definition fontstash.h:41
@ FONS_GLYPH_BITMAP_REQUIRED
Definition fontstash.h:43
@ FONS_GLYPH_BITMAP_OPTIONAL
Definition fontstash.h:42
const unsigned char * fonsGetTextureData(FONScontext *stash, int *width, int *height)
FONScontext * fonsCreateInternal(FONSparams *params)
FONSalign
Definition fontstash.h:29
@ FONS_ALIGN_MIDDLE
Definition fontstash.h:36
@ FONS_ALIGN_LEFT
Definition fontstash.h:31
@ FONS_ALIGN_TOP
Definition fontstash.h:35
@ FONS_ALIGN_RIGHT
Definition fontstash.h:33
@ FONS_ALIGN_CENTER
Definition fontstash.h:32
@ FONS_ALIGN_BASELINE
Definition fontstash.h:38
@ FONS_ALIGN_BOTTOM
Definition fontstash.h:37
int fonsResetAtlas(FONScontext *stash, int width, int height)
void fonsPushState(FONScontext *s)
void fonsSetErrorCallback(FONScontext *s, void(*callback)(void *uptr, int error, int val), void *uptr)
void fonsSetSize(FONScontext *s, float size)
float fonsDrawText(FONScontext *s, float x, float y, const char *string, const char *end)
#define FONS_INVALID
Definition fontstash.h:22
void fonsDeleteInternal(FONScontext *s)
void fonsClearState(FONScontext *s)
struct FONScontext FONScontext
Definition fontstash.h:90
int fonsAddFont(FONScontext *s, const char *name, const char *path, int fontIndex)
void fonsSetFont(FONScontext *s, int font)
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
int val
Definition jpeglib.h:956
JSAMPIMAGE data
Definition jpeglib.h:945
String fallbackFont
Definition juce_Font.cpp:38
RangedDirectoryIterator end(const RangedDirectoryIterator &)
Definition juce_RangedDirectoryIterator.h:184
jack_client_t client jack_client_t client jack_client_t client jack_client_t JackInfoShutdownCallback void arg jack_client_t jack_port_t port void func jack_client_t const char const char unsigned long flags const jack_port_t port jack_client_t jack_port_id_t port_id const jack_port_t const char port_name const jack_port_t port void * ptr
Definition juce_linux_JackAudio.cpp:79
STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint)
STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap)
STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index)
STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels)
STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1)
struct stbtt_fontinfo stbtt_fontinfo
Definition stb_truetype.h:579
STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph)
STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels)
STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing)
STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset)
STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
Definition fontstash.h:57
int(* renderCreate)(void *uptr, int width, int height)
Definition fontstash.h:61
unsigned char flags
Definition fontstash.h:59
void(* renderDelete)(void *uptr)
Definition fontstash.h:65
void * userPtr
Definition fontstash.h:60
int(* renderResize)(void *uptr, int width, int height)
Definition fontstash.h:62
int height
Definition fontstash.h:58
void(* renderUpdate)(void *uptr, int *rect, const unsigned char *data)
Definition fontstash.h:63
int width
Definition fontstash.h:58
void(* renderDraw)(void *uptr, const float *verts, const float *tcoords, const unsigned int *colors, int nverts)
Definition fontstash.h:64
Definition fontstash.h:70
float s1
Definition fontstash.h:72
float s0
Definition fontstash.h:71
float x0
Definition fontstash.h:71
float x1
Definition fontstash.h:72
float y1
Definition fontstash.h:72
float t1
Definition fontstash.h:72
float t0
Definition fontstash.h:71
float y0
Definition fontstash.h:71
Definition fontstash.h:76
const char * next
Definition fontstash.h:83
float nexty
Definition fontstash.h:77
unsigned int utf8state
Definition fontstash.h:85
float scale
Definition fontstash.h:77
float nextx
Definition fontstash.h:77
int bitmapOption
Definition fontstash.h:86
float y
Definition fontstash.h:77
float x
Definition fontstash.h:77
float spacing
Definition fontstash.h:77
unsigned int codepoint
Definition fontstash.h:78
short isize
Definition fontstash.h:79
int prevGlyphIndex
Definition fontstash.h:81
const char * end
Definition fontstash.h:84
struct FONSfont * font
Definition fontstash.h:80
short iblur
Definition fontstash.h:79
const char * str
Definition fontstash.h:82
RECT const char void(* callback)(const char *droppath))) SWELL_API_DEFINE(BOOL
Definition swell-functions.h:1004
int n
Definition crypt.c:458
return c
Definition crypt.c:175
memcpy(hh, h, RAND_HEAD_LEN)
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
register uch * q
Definition fileio.c:817
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
#define SEEK_SET
Definition unzpriv.h:1302
#define SEEK_END
Definition unzpriv.h:1304