Projects · Tools & libraries
HPrint
Header-only C++23 utility for centred terminal headers, with compile-time border characters, UTF-8 aware width and terminal size detection.

$ ./example
>>>>>>>>>>>>>>>>>>>>>>> Build started >>>>>>>>>>>>>>>>>>>>>>>
########################## Phase 1 ##########################
[[[[[[[[[[[[[[[[[[[[[[[ User: mattfor ]]]]]]]]]]]]]]]]]]]]]]]
~~~~~~~~~~~~~~~~~~~~~~~~~ Ünïcödé ~~~~~~~~~~~~~~~~~~~~~~~~~~
********************* 日本語のヘッダー *********************
---------------------- Done in 1.50s -----------------------
A tiny library that does one thing well: print a header centred in the terminal.
#include <hprint>
hp::print<'>'>("Build started");
hp::printf<'#'>("Phase {}", 1);
hp::print<'*'>("日本語のヘッダー", 60);- Border characters are template parameters, so the choice is made at compile time.
std::format-style formatting throughhp::printf/hp::printfw.- Display width is UTF-8 aware, so wide CJK characters stay centred.
- Terminal width is detected on POSIX and Windows, with an 80-column fallback when output isn't a terminal.
- Consumable through CMake
FetchContentorfind_package, with an installable config package.
