![]() |
![]() |
![]() |
![]() |
#define | CHAFA_SYMBOL_WIDTH_PIXELS |
#define | CHAFA_SYMBOL_HEIGHT_PIXELS |
enum | ChafaSymbolTags |
typedef | ChafaSymbolMap |
A ChafaSymbolMap describes a selection of the supported textual symbols that can be used in building a printable output string from a ChafaCanvas.
To create a new ChafaSymbolMap, use chafa_symbol_map_new()
. You can then
add symbols to it using chafa_symbol_map_add_by_tags()
before copying
it into a ChafaCanvasConfig using chafa_canvas_config_set_symbol_map()
.
Note that some symbols match multiple tags, so it makes sense to e.g. add symbols matching CHAFA_SYMBOL_TAG_BORDER and then removing symbols matching CHAFA_SYMBOL_TAG_DIAGONAL.
The number of available symbols is a significant factor in the speed of ChafaCanvas. For the fastest possible operation you could use a single symbol -- CHAFA_SYMBOL_TAG_VHALF works well by itself.
ChafaSymbolMap *
chafa_symbol_map_new (void
);
Creates a new ChafaSymbolMap representing a set of Unicode symbols. The symbol map starts out empty.
void
chafa_symbol_map_ref (ChafaSymbolMap *symbol_map
);
Adds a reference to symbol_map
.
void
chafa_symbol_map_unref (ChafaSymbolMap *symbol_map
);
Removes a reference from symbol_map
. When remaining references drops to
zero, the symbol map is freed and can no longer be used.
void chafa_symbol_map_add_by_tags (ChafaSymbolMap *symbol_map
,ChafaSymbolTags tags
);
Adds symbols matching the set of tags
to symbol_map
.
void chafa_symbol_map_remove_by_tags (ChafaSymbolMap *symbol_map
,ChafaSymbolTags tags
);
Removes symbols matching the set of tags
from symbol_map
.
#define CHAFA_SYMBOL_WIDTH_PIXELS 8
The width of an internal symbol pixel matrix. If you are prescaling input graphics, you will get the best results when scaling to a multiple of this value.
#define CHAFA_SYMBOL_HEIGHT_PIXELS 8
The height of an internal symbol pixel matrix. If you are prescaling input graphics, you will get the best results when scaling to a multiple of this value.
Special value meaning no symbols. |
||
Space. |
||
Solid (inverse of space). |
||
Stipple symbols. |
||
Block symbols. |
||
Border symbols. |
||
Diagonal border symbols. |
||
Symbols that look like isolated dots. |
||
Quadrant block symbols. |
||
Horizontal half block symbols. |
||
Vertical half block symbols. |
||
Joint set of horizontal and vertical halves. |
||
Symbols that are the inverse of simpler symbols. When two symbols complement each other, only one will have this tag. |
||
Special value meaning all supported symbols. |