All of the following information is based on go version go1.17.1 darwin/amd64.
| GOOS | Out of the Box |
|---|---|
aix |
✅ |
android |
✅ |
| #include <stdio.h> | |
| #define HEIGHT 24 | |
| #define STB_TRUETYPE_IMPLEMENTATION | |
| #define STBTT_STATIC | |
| // gcc -Wall -Wno-unused-function -g ttfont.c -o ttfont.exe | |
| // https://github.com/nothings/stb/blob/master/stb_truetype.h | |
| #include "stb_truetype.h" |
| {config, ...}: | |
| let | |
| allowHttps = true; | |
| serverTemplate = { | |
| domain, | |
| proxyTarget, | |
| redirectWww ? false, | |
| enableHttps ? false | |
| }: let |
| // ---- loading a font | |
| static void load_font(void) | |
| { | |
| hb_blob_t *blob; | |
| hb_face_t *face; | |
| size_t filelen = 0; | |
| void *filedata = stb_file("c:/windows/fonts/arial.ttf", &filelen); | |
| if (filedata == 0) stbpg_fatal("Couldn't load font"); |
This is pretty out of date now... you may want to look elsewhere
Newer guides than mine (mine is a bit dated and has a lot of rough edges):
Have you looked at these?
| // Based on http://www.jsoftware.com/jwiki/Essays/Incunabulum | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| typedef struct a { | |
| long t; | |
| long r; | |
| long d[3]; | |
| long p[2]; |
| typedef char C; | |
| typedef long I; | |
| typedef struct a { | |
| I t,r,d[3],p[2]; | |
| }* A; | |
| #define P printf |