gpforge
An advanced bitmap font editor
Loading...
Searching...
No Matches
gpf_glyph Struct Reference

A glyph. More...

#include <font.h>

Data Fields

uint32_t code
 Unicode code point.
uint8_t kind
 enum gpf_glyph_kind
uint8_t has_advance
 The entry carries an advance.
uint8_t has_bearing
 The entry carries both bearings, see has_advance.
uint8_t has_shift
 The entry moves the inherited ink, GPF_GLYPH_METRICS only.
uint8_t modified
 Glyph was modified flag.
int advance
 Glyph advance.
int bearing_x
 Glyph bearing x.
int bearing_y
 Glyph bearing y.
unsigned int width
 Glyph ink width.
unsigned int height
 Glyph ink height.
uint8_t * bits
 Glyph ink.
uint32_t base
 Base glyph, GPF_GLYPH_COMPOSE only.
uint32_t accent
 Accent to be combined with the base, GPF_GLYPH_COMPOSE only.
int dx
 Accent offset, positive right and up, compose only.
int shift_x
 How far the inherited ink is moved, positive right and up.

Detailed Description

A glyph.

Definition at line 80 of file font.h.

Field Documentation

◆ advance

int gpf_glyph::advance

Glyph advance.

Stored per glyph in every variant; in a monospace variant it has to match gpf_variant::advance, which the lint checks.

Definition at line 116 of file font.h.

Referenced by gpf_compose(), gpf_compose_remainder(), gpf_entry_form(), gpf_glyph_flip_h(), and gpf_measure().

◆ bearing_x

int gpf_glyph::bearing_x

Glyph bearing x.

Columns from the origin to the leftmost ink column, may be negative.

Definition at line 122 of file font.h.

Referenced by gpf_accent_offset(), gpf_compose(), gpf_compose_remainder(), gpf_embolden(), gpf_entry_form(), gpf_glyph_clear_ink(), gpf_glyph_flip_h(), gpf_glyph_pixel_get(), gpf_glyph_pixel_set(), gpf_glyph_set_bits(), and gpf_glyph_shift().

◆ bearing_y

int gpf_glyph::bearing_y

Glyph bearing y.

Height of the top ink row above the baseline, positive up.

Definition at line 128 of file font.h.

Referenced by gpf_accent_offset(), gpf_compose(), gpf_compose_remainder(), gpf_entry_form(), gpf_font_ink_extent(), gpf_glyph_clear_ink(), gpf_glyph_pixel_get(), gpf_glyph_pixel_set(), gpf_glyph_set_bits(), gpf_glyph_shift(), and gpf_measure().

◆ bits

uint8_t* gpf_glyph::bits

Glyph ink.

Ink, one byte per pixel, row major, trimmed so that the first and last row and column are non empty. An empty glyph has width and height zero and bits NULL.

Definition at line 145 of file font.h.

Referenced by gpf_accent_ink(), gpf_compose(), gpf_deps_draw(), gpf_embolden(), gpf_entry_form(), gpf_font_simplify(), gpf_glyph_clear(), gpf_glyph_clear_ink(), gpf_glyph_flip_h(), gpf_glyph_flip_v(), gpf_glyph_pixel(), gpf_glyph_pixel_get(), gpf_glyph_pixel_set(), gpf_glyph_set_bits(), gpf_resolved_clear(), gpf_undo_begin(), gpf_undo_free(), and gpf_variant_glyph_del().

◆ has_advance

uint8_t gpf_glyph::has_advance

The entry carries an advance.

For GPF_GLYPH_METRICS this and has_shift say which numbers the block carried, for GPF_GLYPH_INK this and has_bearing are always set.

Definition at line 97 of file font.h.

Referenced by gpf_compose(), gpf_compose_remainder(), and gpf_entry_form().

◆ modified

uint8_t gpf_glyph::modified

Glyph was modified flag.

Edited since the font was last written. Runtime only.

Definition at line 108 of file font.h.

Referenced by gpf_font_clear_modified(), and gpf_undo_commit().

◆ shift_x

int gpf_glyph::shift_x

How far the inherited ink is moved, positive right and up.

A shift and not a place: the ink follows the parent's when the parent is redrawn taller or wider. GPF_GLYPH_METRICS only.

Definition at line 164 of file font.h.

Referenced by gpf_entry_form().


The documentation for this struct was generated from the following file: