CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Widgets
The following functions render custom widgets.
The following functions can be used to create blockquotes:
-
Blockquote(Colour colour)
- Renders a block quote rectangle. This can be called multiple times withImGui::SameLine
to make a blockquote nesting effect -
template<typename ...Args> void Blockquote(const char* fmt, Colour colour, Args... args)
- An abstraction on top ofImGui::Text
andBlockquote
. Renders a blockquote withImGui::Text
. The format string and variadic arguments are passed directly toImGui::Text
-
BlockquoteWrapped(const char* text, const char* end, Colour colour)
- Renders blockquotes with text wrapping, the first 2 arguments are pointers to the beginning and end of the string to be rendered -
BlockquoteWrapped(const std::string& text, Colour colour)
- An abstraction on top of the above function that usesstd::string
instead of pointers to the beginning and end of the string
The colour argument defines the colour of the blockquote rectangle. By default, it is set to
UIMGUI_BLOCKQUOTE_TEXT_COLOUR
, which returns the following RGB colour: rgb(69, 71, 90, 255)
Subscript and superscript rendering are bundled into the same function. This is so that we can easily render them both with a single X starting coordinate, so that we can render text like this:

There are 2 functions that can be used to render subscript and superscript text:
-
SubSuperscript(const char* subscriptBegin, const char* subscriptEnd, const char* superscriptBegin, const char* superscriptEnd)
- Given pointers to the beginning and end of the subscript and superscript strings, renders subscript and superscript text -
SubSuperscript(const std::string& subscript, const std::string& superscript)
- Abstraction on top of the function above that usesstd::string
instead of pointers to the beginning and end of the string to be rendered
It is not possible to apply word wrapping for these 2 functions
Ruby annotations are important for languages like Chinese and Japanese, that use logo-graphic characters, whose pronunciation may not be part of the character. For this reason, ruby text provides additional pronunciation information on top of the word annotated by it. Normally, it looks like this:

Note
We only support horizontal ruby annotation.
There are 2 functions that can be used to render ruby text:
-
Ruby(const char* textBegin, const char* textEnd, const char* annotationBegin, const char* annotationEnd, bool bWrapAnnotation, bool bWrapText
- Given a pointer to the beginning and end of the text and annotation strings, renders text with ruby annotation -
Ruby(const std::string& text, const std::string& annotation, bool bWrapAnnotation, bool bWrapText)
- An abstraction on top of the above function that usesstd::string
instead of pointers to the beginning and end of the strings
There are 2 additional arguments, bWrapAnnotation
and bWrapText
, these 2 booleans default to true
and
false
respectively, but can be overridden if needed. They control word wrapping for the annotation and main text.
The following picture showcases nested blockquotes with wrapping, subscripts, superscripts and ruby text:

This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord, you can click here.