![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <Font.h>
Classes | |
| struct | CPRange |
Public Member Functions | |
| FontDescription (const char *typeface, FontStyle style=FontStyle::NORMAL, int point_size=0) | |
| void | AddTypefaceForLanguage (const char *typeface, const char *lang) |
| void | AddTypefaceForCodePoints (const char *typeface, const std::vector< uint32_t > &code_points) |
Public Attributes | |
| std::vector< CPRange > | ranges_ |
| FontStyle | style_ |
| int | point_size_ |
Static Public Attributes | |
| constexpr static const char * | SANS_SERIF = "sans-serif" |
| constexpr static const char * | MONOSPACE = "monospace" |
|
explicit |
Creates a font description. This must be passed to Application::AddFont() before the window is created.
| typeface | A path to a TrueType (.ttf), TrueType Collection (.ttc), or OpenType (.otf) file, or it is the name of the font, in which case the system font paths will be searched to find the font file. This typeface will be used for roman characters (Extended Latin, that is, European languages). |
| style | Ignored if typeface is a file, but will be used to qualify the font if a system font name is used. Will be applied to any additional language or code point typefaces. |
| point_size | The point size (NOT pixel size) of the font. Will be applied to any additional language or code point typefaces. A size of 0 indicates the default size. |
Definition at line 18 of file Font.cpp.
References point_size_, ranges_, and style_.
| void cloudViewer::visualization::gui::FontDescription::AddTypefaceForCodePoints | ( | const char * | typeface, |
| const std::vector< uint32_t > & | code_points | ||
| ) |
Adds specific code points from the typeface. This is useful for selectively adding glyphs, for example, from an icon font.
Definition at line 31 of file Font.cpp.
References ranges_.
Referenced by cloudViewer::visualization::gui::pybind_gui_classes().
| void cloudViewer::visualization::gui::FontDescription::AddTypefaceForLanguage | ( | const char * | typeface, |
| const char * | lang | ||
| ) |
Adds code points outside Extended Latin from the specified typeface. Supported languages are: "en" (English) [this was already added in the constructor] "ja" (Japanese) "ko" (Korean) "th" (Thai) "vi" (Vietnamese) "zh" (Chinese, 2500 most common characters, 50 MB per window) "zh_all" (Chinese, all characters, ~200 MB per window) All other languages will be assumed to be Cyrillic. Note that generally fonts do not have CJK glyphs unless they are specifically a CJK font, although operating systems generally use a CJK font for you. We do not have the information necessary to do this, so you will need to provide a font that has the glyphs you need. In particular, common fonts like "Arial", "Helvetica", and SANS_SERIF do not contain CJK glyphs.
Definition at line 26 of file Font.cpp.
References ranges_.
Referenced by cloudViewer::visualization::gui::pybind_gui_classes().
|
staticconstexpr |
Definition at line 23 of file Font.h.
Referenced by cloudViewer::visualization::gui::pybind_gui_classes(), and cloudViewer::visualization::gui::Application::SetFont().
| int cloudViewer::visualization::gui::FontDescription::point_size_ |
Definition at line 74 of file Font.h.
Referenced by FontDescription(), and cloudViewer::visualization::gui::Application::SetFont().
| std::vector<CPRange> cloudViewer::visualization::gui::FontDescription::ranges_ |
Definition at line 72 of file Font.h.
Referenced by AddTypefaceForCodePoints(), AddTypefaceForLanguage(), and FontDescription().
|
staticconstexpr |
Definition at line 22 of file Font.h.
Referenced by cloudViewer::visualization::gui::Application::Initialize(), cloudViewer::visualization::gui::pybind_gui_classes(), and cloudViewer::visualization::gui::Application::SetFont().
| FontStyle cloudViewer::visualization::gui::FontDescription::style_ |
Definition at line 73 of file Font.h.
Referenced by FontDescription().