|
ginnOS
The reference: libc, the libraries and the kernel
|
bragi: the monospace grid, with box drawing done in code. More...
#include "bragi_internal.h"Macros | |
| #define | ARMS(up, right, down, left) |
| #define | ARM_UP(a) |
| #define | ARM_RIGHT(a) |
| #define | ARM_DOWN(a) |
| #define | ARM_LEFT(a) |
Functions | |
| void | bragi_cell_size (bragi_face_t *face, int32_t *width, int32_t *height) |
| the cell of a monospace face, in whole pixels: the advance of "M" and the line height. | |
| void | bragi_draw_cell (gfx_buffer_t *buf, bragi_face_t *face, int32_t x, int32_t y, uint32_t codepoint, gfx_color_t color) |
| draw one character in a cell, its top left at (x, y). | |
bragi: the monospace grid, with box drawing done in code.
a font's box drawing glyphs do not always fill the cell (the cell is rounded to whole pixels), so lines in a terminal get gaps. the single and heavy lines (U+2500 to U+254F, U+2574 to U+257F, and the round corners) and the block elements (U+2580 to U+259F) are drawn here as rectangles that fill the cell. the double lines and the diagonals come from the font.
| #define ARMS | ( | up, | |
| right, | |||
| down, | |||
| left ) |
| #define ARM_UP | ( | a | ) |
| #define ARM_RIGHT | ( | a | ) |
| #define ARM_DOWN | ( | a | ) |
| #define ARM_LEFT | ( | a | ) |
| void bragi_cell_size | ( | bragi_face_t * | face, |
| int32_t * | width, | ||
| int32_t * | height ) |
the cell of a monospace face, in whole pixels: the advance of "M" and the line height.
| void bragi_draw_cell | ( | gfx_buffer_t * | buf, |
| bragi_face_t * | face, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| uint32_t | codepoint, | ||
| gfx_color_t | color ) |
draw one character in a cell, its top left at (x, y).
the background is not drawn. the single and heavy box drawing lines and the block elements are drawn by code to fill the cell, so they join from cell to cell; the double lines and the diagonals come from the font.