gpforge
An advanced bitmap font editor
Loading...
Searching...
No Matches
lint.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2026 Cyril Hrubis <metan@ucw.cz>
4 */
13#ifndef GPFORGE_LINT_H
14#define GPFORGE_LINT_H
15
16#include "font.h"
17
18#define GPF_LINT_MSG_MAX 72
19
27
33 uint32_t code;
37 char msg[GPF_LINT_MSG_MAX];
38};
39
49struct gpf_lint_finding *gpf_lint(struct gpf_font *font);
50
62int gpf_lint_glyph(struct gpf_font *font, enum gpf_variant_id id, uint32_t code,
63 struct gpf_lint_finding *out);
64
65/*
66 * How many findings of each severity the whole font has, counted over what
67 * gpf_lint() returns — so the same numbers `gpforge-cli lint` prints.
68 */
69void gpf_lint_count(struct gpf_font *font, unsigned int *errors,
70 unsigned int *warnings);
71
79
80#endif /* GPFORGE_LINT_H */
The in-memory font model.
gpf_variant_id
Font face variant.
Definition font.h:34
const char * gpf_lint_severity_name(enum gpf_lint_severity sev)
Returns severity name.
Definition lint.c:288
int gpf_lint_glyph(struct gpf_font *font, enum gpf_variant_id id, uint32_t code, struct gpf_lint_finding *out)
Runs a linter for a single glyph.
Definition lint.c:232
struct gpf_lint_finding * gpf_lint(struct gpf_font *font)
Runs linter on a font.
Definition lint.c:244
gpf_lint_severity
Linter severity.
Definition lint.h:21
@ GPF_LINT_WARN
Probably a slip. May be deliberate.
Definition lint.h:25
@ GPF_LINT_ERROR
The font renders wrong.
Definition lint.h:23
A font family.
Definition font.h:274
A linter finding.
Definition lint.h:29
uint32_t code
A unicode code point the finding is for.
Definition lint.h:33
enum gpf_lint_severity sev
Severity.
Definition lint.h:35
enum gpf_variant_id id
Variant of the glyph the finding is for.
Definition lint.h:31
char msg[72]
Linter message.
Definition lint.h:37