|
gpforge
An advanced bitmap font editor
|
Glyph editing. More...
#include "font.h"Go to the source code of this file.
Functions | |
| int | gpf_glyph_pixel_get (const struct gpf_glyph *self, int col, int height) |
| Returns a glyph pixel at a given position. | |
| int | gpf_glyph_pixel_set (struct gpf_glyph *self, int col, int height, int set) |
| Sets or clears a glyph pixel. | |
| void | gpf_glyph_shift (struct gpf_glyph *self, int dx, int dy) |
| Moves the glyph ink. | |
| void | gpf_glyph_flip_h (struct gpf_glyph *self) |
| Mirrors the ink horizontally. | |
| void | gpf_glyph_flip_v (struct gpf_glyph *self) |
| Mirrors the ink vertically. | |
| void | gpf_glyph_clear_ink (struct gpf_glyph *self) |
| Clears the glyph ink. | |
Glyph editing.
Pixels are addressed in glyph coordinates, a column counted from the origin and a height counted from the baseline, positive up, never in ink box coordinates.
The ink box is derived from the ink, it grows and shrinks as pixels are set and cleared, and nothing outside of this file needs to know it exists.
Definition in file edit.h.
| void gpf_glyph_clear_ink | ( | struct gpf_glyph * | self | ) |
Clears the glyph ink.
The bearings are reset to zero, the advance is kept.
| self | A glyph to clear. |
Definition at line 114 of file edit.c.
References gpf_glyph::bearing_x, gpf_glyph::bearing_y, gpf_glyph::bits, gpf_glyph::height, and gpf_glyph::width.
| void gpf_glyph_flip_h | ( | struct gpf_glyph * | self | ) |
Mirrors the ink horizontally.
Mirrors the ink horizontally within the advance.
| self | A glyph to mirror. |
Definition at line 81 of file edit.c.
References gpf_glyph::advance, gpf_glyph::bearing_x, gpf_glyph::bits, gpf_glyph::height, and gpf_glyph::width.
| void gpf_glyph_flip_v | ( | struct gpf_glyph * | self | ) |
Mirrors the ink vertically.
Mirrors the ink vertically within the ink box.
| self | A glyph to mirror. |
Definition at line 99 of file edit.c.
References gpf_glyph::bits, gpf_glyph::height, and gpf_glyph::width.
| int gpf_glyph_pixel_get | ( | const struct gpf_glyph * | self, |
| int | col, | ||
| int | height ) |
Returns a glyph pixel at a given position.
| self | A glyph. |
| col | A column counted from a glyph origin. |
| height | A height from a baseline, positive up. |
Definition at line 11 of file edit.c.
References gpf_glyph::bearing_x, gpf_glyph::bearing_y, gpf_glyph::bits, gpf_glyph::height, and gpf_glyph::width.
| int gpf_glyph_pixel_set | ( | struct gpf_glyph * | self, |
| int | col, | ||
| int | height, | ||
| int | set ) |
Sets or clears a glyph pixel.
The ink box grows or is trimmed as needed.
| self | A glyph. |
| col | A column counted from a glyph origin. |
| height | A height from a baseline, positive up. |
| set | A value to set the pixel to 0 or 1. |
Definition at line 22 of file edit.c.
References gpf_glyph::bearing_x, gpf_glyph::bearing_y, gpf_glyph::bits, GPF_MAX, GPF_MIN, gpf_glyph::height, and gpf_glyph::width.
| void gpf_glyph_shift | ( | struct gpf_glyph * | self, |
| int | dx, | ||
| int | dy ) |
Moves the glyph ink.
Moves the ink, which is how the bearings are edited. A glyph with no ink is left alone.
| self | A glyph to shift. |
| dx | An x offset to shift the glyph by, positive right. |
| dy | A y offset to shift the glyph by, positive up. |
Definition at line 72 of file edit.c.
References gpf_glyph::bearing_x, gpf_glyph::bearing_y, and gpf_glyph::width.