gpforge
An advanced bitmap font editor
Loading...
Searching...
No Matches
dialog_family.c
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2026 Cyril Hrubis <metan@ucw.cz>
4 */
5
6#include <stddef.h>
7
8#include <gfxprim.h>
9
10#include "gui.h"
11#include "dialog_family.h"
12
13static const char *dialog_json =
14"{\n"
15" \"info\": {\"version\": 1, \"license\": \"GPL-2.0-or-later\"},\n"
16" \"layout\": {\n"
17" \"widgets\": [\n"
18" {\n"
19" \"type\": \"frame\",\n"
20" \"uid\": \"title\",\n"
21" \"widget\": {\n"
22" \"rows\": 6,\n"
23" \"widgets\": [\n"
24/* the grids fill column by column, so the labels come first */
25" {\"cols\": 2, \"rows\": 3, \"uniform\": false, \"border\": \"none\",\n"
26" \"widgets\": [\n"
27" {\"type\": \"label\", \"text\": \"family\", \"halign\": \"right\"},\n"
28" {\"type\": \"label\", \"text\": \"license\", \"halign\": \"right\"},\n"
29" {\"type\": \"label\", \"text\": \"default glyph U+\",\n"
30" \"halign\": \"right\"},\n"
31" {\"type\": \"tbox\", \"uid\": \"family\", \"len\": 24,\n"
32" \"halign\": \"fill\", \"focused\": true, \"on_event\": \"check\"},\n"
33" {\"type\": \"tbox\", \"uid\": \"license\", \"len\": 24,\n"
34" \"halign\": \"fill\"},\n"
35" {\"type\": \"tbox\", \"uid\": \"default_glyph\", \"len\": 6,\n"
36" \"tattr\": \"mono\", \"halign\": \"left\"}\n"
37" ]\n"
38" },\n"
39" {\"cols\": 2, \"uniform\": true, \"border\": \"none\",\n"
40" \"align\": \"fill\",\n"
41" \"widgets\": [\n"
42" {\"type\": \"frame\", \"title\": \"Line box\", \"align\": \"fill\",\n"
43" \"widget\": {\"cols\": 2, \"rows\": 5, \"border\": \"none\",\n"
44" \"widgets\": [\n"
45" {\"type\": \"label\", \"text\": \"size\", \"halign\": \"right\"},\n"
46" {\"type\": \"label\", \"text\": \"ascent\", \"halign\": \"right\"},\n"
47" {\"type\": \"label\", \"text\": \"descent\", \"halign\": \"right\"},\n"
48" {\"type\": \"label\", \"text\": \"line gap\", \"halign\": \"right\"},\n"
49" {\"type\": \"label\", \"text\": \"mono advance\", \"halign\": \"right\"},\n"
50" {\"type\": \"spinner\", \"uid\": \"size\", \"on_event\": \"check\"},\n"
51" {\"type\": \"spinner\", \"uid\": \"ascent\", \"on_event\": \"check\"},\n"
52" {\"type\": \"spinner\", \"uid\": \"descent\", \"on_event\": \"check\"},\n"
53" {\"type\": \"spinner\", \"uid\": \"line_gap\"},\n"
54" {\"type\": \"spinner\", \"uid\": \"advance\"}\n"
55" ]\n"
56" }\n"
57" },\n"
58" {\"type\": \"frame\", \"title\": \"Letters\", \"align\": \"fill\",\n"
59" \"widget\": {\"cols\": 3, \"rows\": 4, \"border\": \"none\",\n"
60" \"widgets\": [\n"
61" {\"type\": \"label\", \"text\": \"em\", \"halign\": \"right\"},\n"
62" {\"type\": \"label\", \"text\": \"x-height\", \"halign\": \"right\"},\n"
63" {\"type\": \"label\", \"text\": \"cap height\", \"halign\": \"right\"},\n"
64" {\"type\": \"label\", \"text\": \"digit width\", \"halign\": \"right\"},\n"
65" {\"type\": \"spinner\", \"uid\": \"em\"},\n"
66" {\"type\": \"spinner\", \"uid\": \"x_height\", \"on_event\": \"check\"},\n"
67" {\"type\": \"spinner\", \"uid\": \"cap_height\", \"on_event\": \"check\"},\n"
68" {\"type\": \"spinner\", \"uid\": \"ch_width\"},\n"
69" {\"type\": \"label\", \"text\": \"\"},\n"
70" {\"type\": \"button\", \"label\": \"measure\", \"uid\": \"x_height_m\",\n"
71" \"on_event\": \"measure_x_height\"},\n"
72" {\"type\": \"button\", \"label\": \"measure\", \"uid\": \"cap_height_m\",\n"
73" \"on_event\": \"measure_cap_height\"},\n"
74" {\"type\": \"button\", \"label\": \"measure\", \"uid\": \"ch_width_m\",\n"
75" \"on_event\": \"measure_ch_width\"}\n"
76" ]\n"
77" }\n"
78" }\n"
79" ]\n"
80" },\n"
81" {\"type\": \"frame\", \"title\": \"Rules\", \"halign\": \"fill\",\n"
82" \"widget\": {\"cols\": 3, \"rows\": 4, \"border\": \"none\",\n"
83" \"widgets\": [\n"
84" {\"type\": \"label\", \"text\": \"\"},\n"
85" {\"type\": \"label\", \"text\": \"underline\", \"halign\": \"right\"},\n"
86" {\"type\": \"label\", \"text\": \"strikethrough\", \"halign\": \"right\"},\n"
87" {\"type\": \"label\", \"text\": \"overline\", \"halign\": \"right\"},\n"
88" {\"type\": \"label\", \"text\": \"above baseline\"},\n"
89" {\"type\": \"spinner\", \"uid\": \"underline_pos\"},\n"
90" {\"type\": \"spinner\", \"uid\": \"strike_pos\"},\n"
91" {\"type\": \"spinner\", \"uid\": \"overline_pos\"},\n"
92" {\"type\": \"label\", \"text\": \"thickness\"},\n"
93" {\"type\": \"spinner\", \"uid\": \"underline_thickness\"},\n"
94" {\"type\": \"spinner\", \"uid\": \"strike_thickness\"},\n"
95" {\"type\": \"spinner\", \"uid\": \"overline_thickness\"}\n"
96" ]\n"
97" }\n"
98" },\n"
99" {\"type\": \"frame\", \"title\": \"Authors\", \"halign\": \"fill\",\n"
100" \"widget\": {\"rows\": 2, \"border\": \"none\", \"halign\": \"fill\",\n"
101" \"widgets\": [\n"
102" {\"type\": \"table\", \"uid\": \"authors\", \"min_rows\": 3,\n"
103" \"halign\": \"fill\", \"col_ops\": \"authors_ops\",\n"
104" \"header\": [\n"
105" {\"label\": \"years\", \"id\": \"years\", \"min_size\": 9},\n"
106" {\"label\": \"name\", \"id\": \"name\", \"min_size\": 16,\n"
107" \"fill\": 1},\n"
108" {\"label\": \"email\", \"id\": \"email\", \"min_size\": 16,\n"
109" \"fill\": 1}\n"
110" ]\n"
111" },\n"
112" {\"cols\": 5, \"border\": \"none\", \"halign\": \"fill\",\n"
113" \"cfill\": \"0, 1, 1, 0, 0\",\n"
114" \"widgets\": [\n"
115" {\"type\": \"tbox\", \"uid\": \"author_years\", \"len\": 9,\n"
116" \"max_len\": 31, \"help\": \"2024\"},\n"
117" {\"type\": \"tbox\", \"uid\": \"author_name\", \"len\": 12,\n"
118" \"max_len\": 63, \"help\": \"name\", \"halign\": \"fill\"},\n"
119" {\"type\": \"tbox\", \"uid\": \"author_email\", \"len\": 12,\n"
120" \"max_len\": 63, \"help\": \"email\", \"halign\": \"fill\"},\n"
121" {\"type\": \"button\", \"label\": \"add\", \"uid\": \"author_add\",\n"
122" \"on_event\": \"author_add\"},\n"
123" {\"type\": \"button\", \"label\": \"remove\",\n"
124" \"uid\": \"author_del\", \"on_event\": \"author_del\"}\n"
125" ]\n"
126" }\n"
127" ]\n"
128" }\n"
129" },\n"
130" {\"type\": \"label\", \"uid\": \"note\", \"text\": \"\", \"width\": 40,\n"
131" \"halign\": \"fill\"},\n"
132" {\"cols\": 2,\n"
133" \"halign\": \"fill\",\n"
134" \"cpadf\": \"1, 1, 1\",\n"
135" \"cfill\": \"0, 0\",\n"
136" \"border\": \"none\",\n"
137" \"uniform\": true,\n"
138" \"widgets\": [\n"
139" {\"type\": \"button\", \"halign\": \"fill\", \"label\": \"Cancel\",\n"
140" \"btype\": \"cancel\", \"on_event\": \"cancel\"},\n"
141" {\"type\": \"button\", \"halign\": \"fill\", \"label\": \"OK\",\n"
142" \"btype\": \"ok\", \"uid\": \"ok\", \"on_event\": \"ok\"}\n"
143" ]\n"
144" }\n"
145" ]\n"
146" }\n"
147" }\n"
148" ]\n"
149" }\n"
150"}\n";
151
152/*
153 * The numbers, by the uid of the spinner that edits them. A zero thickness is
154 * "the font does not say", which the export leaves out.
155 */
156static const struct field {
157 const char *uid;
158 size_t off;
159 int min, max;
160} fields[] = {
161#define FIELD(name, min, max) \
162 {#name, offsetof(struct gpf_family_meta, name), min, max}
163 FIELD(size, 1, 255),
164 FIELD(ascent, 1, 255),
165 FIELD(descent, 0, 255),
166 FIELD(line_gap, 0, 255),
167 FIELD(em, 1, 255),
168 FIELD(x_height, 0, 255),
169 FIELD(cap_height, 0, 255),
170 FIELD(ch_width, 0, 255),
171 FIELD(underline_pos, -255, 255),
172 FIELD(underline_thickness, 0, 255),
173 FIELD(strike_pos, -255, 255),
174 FIELD(strike_thickness, 0, 255),
175 FIELD(overline_pos, -255, 255),
176 FIELD(overline_thickness, 0, 255),
177#undef FIELD
178};
179
180#define FIELDS (sizeof(fields) / sizeof(fields[0]))
181
182static int field_get(const struct gpf_family_meta *meta,
183 const struct field *field)
184{
185 return *(const int *)((const char *)meta + field->off);
186}
187
188static void field_set(struct gpf_family_meta *meta, const struct field *field,
189 int val)
190{
191 *(int *)((char *)meta + field->off) = val;
192}
193
194static gp_htable *uids;
195
196/* the caller's copy of the authors, which the table shows and the buttons edit */
197static struct gpf_author **authors;
198
199/* what add or remove last had to say, shown until the next add or remove */
200static const char *author_msg;
201
202/*
203 * A font is being created rather than edited. Whatever is open is not the
204 * font this is about then, so there is nothing to measure.
205 */
206static int creating;
207
208static gp_widget *spinner(const char *uid)
209{
210 return gp_widget_by_uid(uids, uid, GP_WIDGET_SPINNER);
211}
212
213static int spinner_val(const char *uid)
214{
215 gp_widget *widget = spinner(uid);
216
217 return widget ? gp_widget_int_val_get(widget) : 0;
218}
219
220static const char *tbox_text(const char *uid)
221{
222 gp_widget *widget = gp_widget_by_uid(uids, uid, GP_WIDGET_TBOX);
223
224 return widget ? gp_widget_tbox_text(widget) : "";
225}
226
227/*
228 * What is wrong with the numbers, if anything. Only a nameless family is
229 * refused; the rest is said and left to the user, since a font that breaks a
230 * rule on purpose is still a font.
231 */
232static void check(void)
233{
234 gp_widget *note = gp_widget_by_uid(uids, "note", GP_WIDGET_LABEL);
235 gp_widget *ok = gp_widget_by_uid(uids, "ok", GP_WIDGET_BUTTON);
236 int ascent = spinner_val("ascent");
237 int size = spinner_val("size");
238 const char *msg = "";
239
240 if (size < ascent || size > ascent + spinner_val("descent"))
241 msg = "the size is not within the line box";
242
243 if (spinner_val("x_height") > ascent)
244 msg = "the x-height is above the ascent";
245
246 if (spinner_val("cap_height") > ascent)
247 msg = "the cap height is above the ascent";
248
249 if (author_msg)
250 msg = author_msg;
251
252 if (!tbox_text("family")[0])
253 msg = "the family needs a name";
254
255 if (note)
256 gp_widget_label_set(note, msg);
257
258 if (ok)
259 gp_widget_disabled_set(ok, !tbox_text("family")[0]);
260}
261
262static int check_on_event(gp_widget_event *ev)
263{
264 if (ev->type == GP_WIDGET_EVENT_WIDGET)
265 check();
266
267 return 0;
268}
269
270static void measure(enum gpf_measure what, const char *uid)
271{
272 gp_widget *widget = spinner(uid);
273 int val;
274
275 if (!widget || creating || gpf_measure(gui.font, gui.variant, what, &val))
276 return;
277
278 gp_widget_int_val_set(widget, val);
279
280 check();
281}
282
283static int measure_x_height_on_event(gp_widget_event *ev)
284{
285 if (ev->type == GP_WIDGET_EVENT_WIDGET)
286 measure(GPF_MEASURE_X_HEIGHT, "x_height");
287
288 return 0;
289}
290
291static int measure_cap_height_on_event(gp_widget_event *ev)
292{
293 if (ev->type == GP_WIDGET_EVENT_WIDGET)
294 measure(GPF_MEASURE_CAP_HEIGHT, "cap_height");
295
296 return 0;
297}
298
299static int measure_ch_width_on_event(gp_widget_event *ev)
300{
301 if (ev->type == GP_WIDGET_EVENT_WIDGET)
302 measure(GPF_MEASURE_CH_WIDTH, "ch_width");
303
304 return 0;
305}
306
307enum authors_col {
308 AUTHORS_YEARS,
309 AUTHORS_NAME,
310 AUTHORS_EMAIL,
311};
312
313static int authors_seek_row(gp_widget *self, int op, unsigned int pos)
314{
315 gp_widget_table_priv *priv = gp_widget_table_priv_get(self);
316 size_t len = gp_vec_len(*authors);
317
318 switch (op) {
319 case GP_TABLE_ROW_RESET:
320 priv->row_idx = 0;
321 break;
322 case GP_TABLE_ROW_ADVANCE:
323 priv->row_idx += pos;
324 break;
325 case GP_TABLE_ROW_MAX:
326 return len;
327 }
328
329 return priv->row_idx < len;
330}
331
332static int authors_get_cell(gp_widget *self, gp_widget_table_cell *cell,
333 unsigned int col)
334{
335 gp_widget_table_priv *priv = gp_widget_table_priv_get(self);
336 const struct gpf_author *author = &(*authors)[priv->row_idx];
337
338 switch (col) {
339 case AUTHORS_YEARS:
340 cell->text = author->years;
341 break;
342 case AUTHORS_NAME:
343 cell->text = author->name;
344 break;
345 case AUTHORS_EMAIL:
346 cell->text = author->email;
347 break;
348 }
349
350 return 1;
351}
352
353static void tbox_set(const char *uid, const char *text)
354{
355 gp_widget *widget = gp_widget_by_uid(uids, uid, GP_WIDGET_TBOX);
356
357 if (widget)
358 gp_widget_tbox_set(widget, text);
359}
360
361/* the author selected in the table, filled in the fields to be corrected */
362static int authors_on_event(gp_widget_event *ev)
363{
364 const struct gpf_author *author;
365 unsigned int row;
366
367 if (ev->type != GP_WIDGET_EVENT_WIDGET ||
368 !gp_widget_table_sel_has(ev->self))
369 return 0;
370
371 row = gp_widget_table_sel_get(ev->self);
372 if (row >= gp_vec_len(*authors))
373 return 0;
374
375 author = &(*authors)[row];
376
377 tbox_set("author_years", author->years);
378 tbox_set("author_name", author->name);
379 tbox_set("author_email", author->email);
380
381 return 0;
382}
383
384static const gp_widget_table_col_ops authors_ops = {
385 .seek_row = authors_seek_row,
386 .get_cell = authors_get_cell,
387 .on_event = authors_on_event,
388 .col_map = {
389 {.id = "years", .idx = AUTHORS_YEARS},
390 {.id = "name", .idx = AUTHORS_NAME},
391 {.id = "email", .idx = AUTHORS_EMAIL},
392 {}
393 }
394};
395
396static gp_widget *authors_table(void)
397{
398 return gp_widget_by_uid(uids, "authors", GP_WIDGET_TABLE);
399}
400
401static int author_add_on_event(gp_widget_event *ev)
402{
403 const char *years = tbox_text("author_years");
404 const char *name = tbox_text("author_name");
405 const char *email = tbox_text("author_email");
406 gp_widget *table = authors_table();
407
408 if (ev->type != GP_WIDGET_EVENT_WIDGET)
409 return 0;
410
411 author_msg = gpf_author_invalid(years, name, email);
412
413 if (!author_msg && gpf_authors_add(authors, years, name, email))
414 author_msg = "out of memory";
415
416 if (!author_msg) {
417 tbox_set("author_years", "");
418 tbox_set("author_name", "");
419 tbox_set("author_email", "");
420 }
421
422 if (table)
423 gp_widget_table_refresh(table);
424
425 check();
426
427 return 0;
428}
429
430static int author_del_on_event(gp_widget_event *ev)
431{
432 gp_widget *table = authors_table();
433
434 if (ev->type != GP_WIDGET_EVENT_WIDGET || !table)
435 return 0;
436
437 author_msg = NULL;
438
439 if (!gp_widget_table_sel_has(table))
440 author_msg = "select an author to remove";
441 else
442 gpf_authors_del(authors, gp_widget_table_sel_get(table));
443
444 gp_widget_table_refresh(table);
445
446 check();
447
448 return 0;
449}
450
451static int ok_on_event(gp_widget_event *ev)
452{
453 gp_dialog *dialog = ev->self->priv;
454
455 if (ev->type != GP_WIDGET_EVENT_WIDGET)
456 return 0;
457
458 dialog->retval = GP_DIALOG_YES;
459
460 return 0;
461}
462
463static int cancel_on_event(gp_widget_event *ev)
464{
465 gp_dialog *dialog = ev->self->priv;
466
467 if (ev->type != GP_WIDGET_EVENT_WIDGET)
468 return 0;
469
470 dialog->retval = GP_DIALOG_NO;
471
472 return 0;
473}
474
475static const gp_widget_json_addr addrs[] = {
476 {.id = "author_add", .on_event = author_add_on_event},
477 {.id = "author_del", .on_event = author_del_on_event},
478 {.id = "authors_ops", .addr = (void *)&authors_ops},
479 {.id = "cancel", .on_event = cancel_on_event},
480 {.id = "check", .on_event = check_on_event},
481 {.id = "measure_cap_height", .on_event = measure_cap_height_on_event},
482 {.id = "measure_ch_width", .on_event = measure_ch_width_on_event},
483 {.id = "measure_x_height", .on_event = measure_x_height_on_event},
484 {.id = "ok", .on_event = ok_on_event},
485 {}
486};
487
488/*
489 * A measure button the variant cannot answer is greyed out, rather than
490 * pressed to no effect.
491 */
492static void measure_enable(const char *uid, enum gpf_measure what)
493{
494 gp_widget *widget = gp_widget_by_uid(uids, uid, GP_WIDGET_BUTTON);
495 int val, none;
496
497 if (!widget)
498 return;
499
500 none = creating || gpf_measure(gui.font, gui.variant, what, &val);
501
502 gp_widget_disabled_set(widget, none);
503}
504
505/*
506 * The mono cell, which is asked for when a font is created and only shown when
507 * one is edited.
508 */
509static void load_advance(const int *advance)
510{
511 gp_widget *widget = spinner("advance");
512 struct gpf_variant *mono;
513
514 if (!widget)
515 return;
516
517 if (advance) {
518 gp_widget_int_set(widget, 1, 255, *advance);
519 return;
520 }
521
522 mono = gui.font ? gui.font->variants[GPF_MONO] : NULL;
523
524 gp_widget_int_set(widget, 0, 255, mono ? mono->advance : 0);
525 gp_widget_disabled_set(widget, 1);
526}
527
528static void load(const struct gpf_family_meta *meta, const int *advance)
529{
530 gp_widget *widget;
531 size_t i;
532
533 for (i = 0; i < FIELDS; i++) {
534 widget = spinner(fields[i].uid);
535 if (widget) {
536 gp_widget_int_set(widget, fields[i].min, fields[i].max,
537 field_get(meta, &fields[i]));
538 }
539 }
540
541 widget = gp_widget_by_uid(uids, "family", GP_WIDGET_TBOX);
542 if (widget)
543 gp_widget_tbox_set(widget, meta->family);
544
545 widget = gp_widget_by_uid(uids, "license", GP_WIDGET_TBOX);
546 if (widget)
547 gp_widget_tbox_set(widget, meta->license);
548
549 widget = gp_widget_by_uid(uids, "default_glyph", GP_WIDGET_TBOX);
550 if (widget) {
551 if (meta->default_glyph) {
552 gp_widget_tbox_printf(widget, "%04X",
553 meta->default_glyph);
554 }
555 gp_widget_tbox_filter_set(widget, GP_TBOX_FILTER_HEX);
556 }
557
558 measure_enable("x_height_m", GPF_MEASURE_X_HEIGHT);
559 measure_enable("cap_height_m", GPF_MEASURE_CAP_HEIGHT);
560 measure_enable("ch_width_m", GPF_MEASURE_CH_WIDTH);
561
562 load_advance(advance);
563}
564
565static void store(struct gpf_family_meta *meta, int *advance)
566{
567 size_t i;
568
569 for (i = 0; i < FIELDS; i++) {
570 if (spinner(fields[i].uid))
571 field_set(meta, &fields[i], spinner_val(fields[i].uid));
572 }
573
574 snprintf(meta->family, sizeof(meta->family), "%s", tbox_text("family"));
575 snprintf(meta->license, sizeof(meta->license), "%s",
576 tbox_text("license"));
577
578 /* an empty field is no default glyph, which the writer leaves out */
579 meta->default_glyph = strtoul(tbox_text("default_glyph"), NULL, 16);
580
581 if (advance && spinner("advance"))
582 *advance = spinner_val("advance");
583}
584
585int gpf_dialog_family(struct gpf_family_meta *meta,
586 struct gpf_author **edit_authors, int *advance)
587{
588 gp_dialog dialog = {};
589 gp_widget_json_callbacks callbacks = {
590 .default_priv = &dialog,
591 .addrs = addrs,
592 };
593 gp_widget *frame;
594 int ret = 1;
595
596 /* editing needs a font to edit */
597 if (!advance && !gui.font)
598 return 1;
599
600 creating = !!advance;
601 authors = edit_authors;
602 author_msg = NULL;
603
604 dialog.layout = gp_dialog_layout_load("gpforge_family", &callbacks,
605 dialog_json, &uids);
606 if (!dialog.layout)
607 return 1;
608
609 frame = gp_widget_by_uid(uids, "title", GP_WIDGET_FRAME);
610 if (frame)
611 gp_widget_frame_title_set(frame, creating ? "New font" :
612 "Font properties");
613
614 load(meta, advance);
615 check();
616
617 if (gp_dialog_run(&dialog) == GP_DIALOG_YES) {
618 store(meta, advance);
619 ret = 0;
620 }
621
622 gp_htable_free(uids);
623 uids = NULL;
624 gp_widget_free(dialog.layout);
625 authors = NULL;
626
627 return ret;
628}
The font properties dialog.
const char * gpf_author_invalid(const char *years, const char *name, const char *email)
Checks the fields of an author.
Definition font.c:397
void gpf_authors_del(struct gpf_author **authors, size_t idx)
Removes an author from a gp_vec of authors.
Definition font.c:450
@ GPF_MONO
Monospace glyphs, the base variant.
Definition font.h:36
int gpf_authors_add(struct gpf_author **authors, const char *years, const char *name, const char *email)
Appends an author to a gp_vec of authors.
Definition font.c:426
The editor state and the functions everything in the GUI goes through.
gpf_measure
The family metrics that are measured off the glyphs.
Definition resolve.h:154
@ GPF_MEASURE_CH_WIDTH
The advance of the '0' glyph.
Definition resolve.h:160
@ GPF_MEASURE_CAP_HEIGHT
The top of the 'H' ink above the baseline.
Definition resolve.h:158
@ GPF_MEASURE_X_HEIGHT
The top of the 'x' ink above the baseline.
Definition resolve.h:156
A font author, one author line of the family file.
Definition font.h:218
char years[32]
Copyright years, e.g. "2024", "2019-2024" or "2019,2023".
Definition font.h:220
char email[64]
The author's email, without the angle brackets.
Definition font.h:224
char name[64]
The author's name.
Definition font.h:222
Font family meta data.
Definition font.h:230
uint32_t default_glyph
The unicode code point of the default glyph.
Definition font.h:268
char license[64]
SPDX license name.
Definition font.h:234
char family[64]
Font family name.
Definition font.h:232
A font variant.
Definition font.h:170
int advance
Advance for all glyphs.
Definition font.h:182