gpforge
An advanced bitmap font editor
Loading...
Searching...
No Matches
unicode_blocks.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 */
12#ifndef GPFORGE_UNICODE_BLOCKS_H
13#define GPFORGE_UNICODE_BLOCKS_H
14
15#include <stdint.h>
16
17#include "font.h"
18
24 uint32_t min;
26 uint32_t max;
28 const char *name;
34 unsigned int coverage;
35};
36
40extern const struct gpf_ucode_block gpf_ucode_blocks[];
41
49const char *gpf_ucode_block_sample(const char *name);
50
60struct gpf_ucode_block *gpf_blocks_build(struct gpf_font *font);
61
70int gpf_blocks_find(const struct gpf_ucode_block *blocks, uint32_t code);
71
78static inline uint32_t gpf_block_glyphs(const struct gpf_ucode_block *block)
79{
80 return block->max - block->min + 1;
81}
82
83#endif /* GPFORGE_UNICODE_BLOCKS_H */
The in-memory font model.
A font family.
Definition font.h:274
A unicode block description.
const char * name
Human readable name of the block.
unsigned int coverage
Number of glyphs the font has in this block.
uint32_t max
Last code point in the block.
uint32_t min
First code point in the block.
int gpf_blocks_find(const struct gpf_ucode_block *blocks, uint32_t code)
Looks up a block by a codepoint.
const char * gpf_ucode_block_sample(const char *name)
Looks up the preview sample text for a unicode block.
struct gpf_ucode_block * gpf_blocks_build(struct gpf_font *font)
Builds a list of blocks for a font.
static uint32_t gpf_block_glyphs(const struct gpf_ucode_block *block)
Counts number of codepoints in a unicode block.