summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-28 17:00:49 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-28 17:00:49 -0500
commit410b9b764c4a6c81a3573cf7ca23330d43931829 (patch)
tree9766f5245c9c71a8a67948ef8d2bb05613d74a01 /text.c
parent52fd5e0c95da236fd14682ed8a7cfa34afbab2c0 (diff)
speed up debug build time
Diffstat (limited to 'text.c')
-rw-r--r--text.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/text.c b/text.c
index 1096e8c..9e9246f 100644
--- a/text.c
+++ b/text.c
@@ -1,11 +1,29 @@
#include "base.h"
#include "text.h"
#include "unicode.h"
+#if DEBUG
+typedef struct
+{
+ unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap
+ float xoff,yoff,xadvance;
+} stbtt_bakedchar;
+typedef struct
+{
+ float x0,y0,s0,t0; // top-left
+ float x1,y1,s1,t1; // bottom-right
+} stbtt_aligned_quad;
+
+extern void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule);
+extern int stbtt_BakeFontBitmap(const unsigned char *data, int offset, float pixel_height, unsigned char *pixels, int pw, int ph, int first_char, int num_chars, stbtt_bakedchar *chardata);
+#else
#define STB_TRUETYPE_IMPLEMENTATION
#define STBTT_STATIC
no_warn_start
#include "lib/stb_truetype.h"
no_warn_end
+#endif
+
+
#include <stdlib.h>
// We split up code points into a bunch of pages, so we don't have to load all of the font at