add notcurses_canhalfblock()/notcurses_canquadrant() #1575

pull/1573/head
nick black 3 years ago
parent 9b38fe515c
commit f4aa419a31
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -3,6 +3,7 @@ rearrangements of Notcurses.
* 2.2.9 (not yet released)
* Added two new stats, `sprixelemissions` and `sprixelelisions`.
* Added `notcurses_canhalfblock()` and `notcurses_canquadrant()`.
* 2.2.8 (2021-04-18)
* All remaining functions prefixed with `cell_` or `cells_` have been

@ -297,6 +297,12 @@ bool notcurses_canchangecolor(const struct notcurses* nc);
// Is our encoding UTF-8? Requires LANG being set to a UTF-8 locale.
bool notcurses_canutf8(const struct notcurses* nc);
// Can we reliably use Unicode halfblocks?
bool notcurses_canhalfblock(const struct notcurses* nc);
// Can we reliably use Unicode quadrants?
bool notcurses_canquadrant(const struct notcurses* nc);
// Can we draw sextants? This requires Unicode 13.
bool notcurses_cansextants(const struct notcurses* nc);

@ -26,6 +26,10 @@ notcurses_capabilities - runtime capability detection
**bool notcurses_canutf8(const struct notcurses* ***nc***);**
**bool notcurses_canhalfblock(const struct notcurses* ***nc***);**
**bool notcurses_canquadrant(const struct notcurses* ***nc***);**
**bool notcurses_cansextant(const struct notcurses* ***nc***);**
**bool notcurses_canbraille(const struct notcurses* ***nc***);**
@ -63,10 +67,12 @@ multimedia support capable of decoding videos.
UTF-8 encoding, and the locale was successfully loaded.
**notcurses_cansextant** returns **true** if the heuristics suggest
that the terminal can properly render Unicode 13 sextants.
**notcurses_canbraille** returns **true** if Braille is expected to work on the
terminal.
that the terminal can properly render Unicode 13 sextants. Likewise,
**notcurses_canquadrant** and **notcurses_canhalfblock** return **true**
if the heuristics suggest that the terminal can properly render Unicode
quadrants and halfblocks, respectively. **notcurses_canbraille** returns
**true** if Unicode Braille is expected to work on the terminal. None of
these functions return **true** unless UTF-8 encoding is in use.
**notcurses_check_pixel_support** returns 1 if bitmap support (via any
mechanism) is detected; **NCBLIT_PIXEL** can be used after such a return.

@ -1262,6 +1262,12 @@ API bool notcurses_canopen_videos(const struct notcurses* nc);
// Is our encoding UTF-8? Requires LANG being set to a UTF8 locale.
API bool notcurses_canutf8(const struct notcurses* nc);
// Can we reliably use Unicode halfblocks?
API bool notcurses_canhalfblock(const struct notcurses* nc);
// Can we reliably use Unicode quadrants?
API bool notcurses_canquadrant(const struct notcurses* nc);
// Can we reliably use Unicode 13 sextants?
API bool notcurses_cansextant(const struct notcurses* nc);

@ -2047,6 +2047,14 @@ bool notcurses_canutf8(const notcurses* nc){
return nc->tcache.utf8;
}
bool notcurses_canhalfblock(const notcurses* nc){
return nc->tcache.utf8;
}
bool notcurses_canquadrant(const notcurses* nc){
return nc->tcache.quadrants && nc->tcache.utf8;
}
bool notcurses_cansextant(const notcurses* nc){
return nc->tcache.sextants && nc->tcache.utf8;
}

Loading…
Cancel
Save