Skip to content

Commit

Permalink
symbols: Make the block symbol classes complete
Browse files Browse the repository at this point in the history
Now the "octant", "quad", etc. will each be complete without the need
to aggregate octant+quad+vhalf+space manually.
  • Loading branch information
hpjansson committed Nov 7, 2024
1 parent 5290444 commit 5b80fd7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 35 deletions.
4 changes: 3 additions & 1 deletion chafa/internal/chafa-symbols-ascii.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

{
/* [ ] */
CHAFA_SYMBOL_TAG_ASCII | CHAFA_SYMBOL_TAG_LATIN | CHAFA_SYMBOL_TAG_SPACE,
CHAFA_SYMBOL_TAG_ASCII | CHAFA_SYMBOL_TAG_LATIN | CHAFA_SYMBOL_TAG_SPACE
| CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_SEXTANT
| CHAFA_SYMBOL_TAG_OCTANT,
0x20,
CHAFA_SYMBOL_OUTLINE_8X8 (
" "
Expand Down
64 changes: 37 additions & 27 deletions chafa/internal/chafa-symbols-block.h
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,8 @@
" X ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_VHALF | CHAFA_SYMBOL_TAG_INVERTED,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_VHALF | CHAFA_SYMBOL_TAG_QUAD
| CHAFA_SYMBOL_TAG_OCTANT | CHAFA_SYMBOL_TAG_INVERTED,
0x2580,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -1286,7 +1287,7 @@
"XXXXXXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_OCTANT,
0x2582,
CHAFA_SYMBOL_OUTLINE_8X8 (
" "
Expand All @@ -1312,7 +1313,8 @@
"XXXXXXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_VHALF,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_VHALF | CHAFA_SYMBOL_TAG_QUAD
| CHAFA_SYMBOL_TAG_OCTANT,
0x2584,
CHAFA_SYMBOL_OUTLINE_8X8 (
" "
Expand All @@ -1338,7 +1340,7 @@
"XXXXXXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_OCTANT,
0x2586,
CHAFA_SYMBOL_OUTLINE_8X8 (
" "
Expand All @@ -1365,7 +1367,8 @@
},
{
/* Full block */
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_SOLID | CHAFA_SYMBOL_TAG_SEXTANT,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_SOLID | CHAFA_SYMBOL_TAG_QUAD
| CHAFA_SYMBOL_TAG_SEXTANT | CHAFA_SYMBOL_TAG_OCTANT,
0x2588,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand Down Expand Up @@ -1417,7 +1420,8 @@
"XXXXX ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_HHALF | CHAFA_SYMBOL_TAG_SEXTANT,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_HHALF | CHAFA_SYMBOL_TAG_QUAD
| CHAFA_SYMBOL_TAG_SEXTANT | CHAFA_SYMBOL_TAG_OCTANT,
0x258c,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXX "
Expand Down Expand Up @@ -1469,7 +1473,8 @@
"X ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_HHALF | CHAFA_SYMBOL_TAG_INVERTED | CHAFA_SYMBOL_TAG_SEXTANT,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_HHALF | CHAFA_SYMBOL_TAG_QUAD
| CHAFA_SYMBOL_TAG_SEXTANT | CHAFA_SYMBOL_TAG_OCTANT | CHAFA_SYMBOL_TAG_INVERTED,
0x2590,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXX"
Expand Down Expand Up @@ -1547,7 +1552,7 @@
" X")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT,
0x2596,
CHAFA_SYMBOL_OUTLINE_8X8 (
" "
Expand All @@ -1560,7 +1565,7 @@
"XXXX ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT,
0x2597,
CHAFA_SYMBOL_OUTLINE_8X8 (
" "
Expand All @@ -1573,7 +1578,7 @@
" XXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT,
0x2598,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXX "
Expand All @@ -1586,7 +1591,8 @@
" ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_INVERTED,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT
| CHAFA_SYMBOL_TAG_INVERTED,
0x2599,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXX "
Expand All @@ -1599,7 +1605,7 @@
"XXXXXXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT,
0x259a,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXX "
Expand All @@ -1612,7 +1618,8 @@
" XXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_INVERTED,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT
| CHAFA_SYMBOL_TAG_INVERTED,
0x259b,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -1625,7 +1632,8 @@
"XXXX ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_INVERTED,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT
| CHAFA_SYMBOL_TAG_INVERTED,
0x259c,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -1638,7 +1646,7 @@
" XXXX")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT,
0x259d,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXX"
Expand All @@ -1651,7 +1659,8 @@
" ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_INVERTED,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT
| CHAFA_SYMBOL_TAG_INVERTED,
0x259e,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXX"
Expand All @@ -1664,7 +1673,8 @@
"XXXX ")
},
{
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_INVERTED,
CHAFA_SYMBOL_TAG_BLOCK | CHAFA_SYMBOL_TAG_QUAD | CHAFA_SYMBOL_TAG_OCTANT
| CHAFA_SYMBOL_TAG_INVERTED,
0x259f,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXX"
Expand Down Expand Up @@ -2589,7 +2599,7 @@
"XXXXXXXX")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_OCTANT | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb82,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -2602,7 +2612,7 @@
" ")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb83,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -2615,7 +2625,7 @@
" ")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb84,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -2628,7 +2638,7 @@
" ")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_OCTANT | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb85,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -2641,7 +2651,7 @@
" ")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb86,
CHAFA_SYMBOL_OUTLINE_8X8 (
"XXXXXXXX"
Expand All @@ -2654,7 +2664,7 @@
" ")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb87,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XX"
Expand All @@ -2667,7 +2677,7 @@
" XX")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb88,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXX"
Expand All @@ -2680,7 +2690,7 @@
" XXX")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb89,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXXX"
Expand All @@ -2693,7 +2703,7 @@
" XXXXX")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb8a,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXXXX"
Expand All @@ -2706,7 +2716,7 @@
" XXXXXX")
},
{
CHAFA_SYMBOL_TAG_LEGACY,
CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_INVERTED,
0x1fb8b,
CHAFA_SYMBOL_OUTLINE_8X8 (
" XXXXXXX"
Expand Down
9 changes: 2 additions & 7 deletions chafa/internal/chafa-symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,16 +490,11 @@ generate_octant_syms (ChafaSymbol *syms, gint first_ofs)

c = octant_bits_to_unichar (oct);

#if 0
/* Skip block symbols; we already have those */
/* FIXME: Need to merge duplicates */
if (c < 0x1cd00)
if (c < 0x1cd00 || c > 0x1d000)
continue;

g_printerr ("%08x\n", c);
#endif

sym->sc = CHAFA_SYMBOL_TAG_OCTANT;
sym->sc = CHAFA_SYMBOL_TAG_LEGACY | CHAFA_SYMBOL_TAG_OCTANT;
sym->c = c;
sym->coverage = g_malloc (CHAFA_SYMBOL_N_PIXELS);

Expand Down

0 comments on commit 5b80fd7

Please sign in to comment.