renderer: use direct FreeType with explicit font files

This commit is contained in:
2026-08-13 20:40:38 +09:00
parent 125e9349c0
commit f46d51b539
16 changed files with 314 additions and 5201 deletions

10
main.c
View File

@@ -5,12 +5,13 @@ Channel *drawc;
Channel *keyc;
Channel *dictreqc;
Channel *dictresc;
char *fontdir;
char **fontfiles;
int nfontfiles;
void
usage(void)
{
fprint(2, "usage: strans mapdir fontdir\n");
fprint(2, "usage: strans mapdir fontfile [fontfile ...]\n");
threadexitsall("usage");
}
@@ -50,10 +51,11 @@ erealloc(void *p, ulong n)
void
threadmain(int argc, char **argv)
{
if(argc != 3)
if(argc < 3 || argc > Maxfonts + 2)
usage();
fontdir = argv[2];
fontfiles = argv + 2;
nfontfiles = argc - 2;
drawc = chancreate(sizeof(Drawcmd), 4);
keyc = chancreate(sizeof(Keyreq), 0);
dictreqc = chancreate(sizeof(Dictreq), 4);