Open3D (C++ API)  0.18.0+252c867
Data Structures | Public Member Functions | Data Fields | Static Public Attributes
open3d::visualization::gui::FontDescription Class Reference

#include <Font.h>

Data Structures

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)
 

Data Fields

std::vector< CPRangeranges_
 
FontStyle style_
 
int point_size_
 

Static Public Attributes

constexpr static const char * SANS_SERIF = "sans-serif"
 
constexpr static const char * MONOSPACE = "monospace"
 

Constructor & Destructor Documentation

◆ FontDescription()

open3d::visualization::gui::FontDescription::FontDescription ( const char *  typeface,
FontStyle  style = FontStyle::NORMAL,
int  point_size = 0 
)
explicit

Creates a font description. This must be passed to Application::AddFont() before the window is created.

Parameters
typefaceA 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).
styleIgnored 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_sizeThe 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.

Member Function Documentation

◆ AddTypefaceForCodePoints()

void open3d::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.

◆ AddTypefaceForLanguage()

void open3d::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.

Field Documentation

◆ MONOSPACE

constexpr const char * open3d::visualization::gui::FontDescription::MONOSPACE = "monospace"
staticconstexpr

◆ point_size_

int open3d::visualization::gui::FontDescription::point_size_

◆ ranges_

std::vector<CPRange> open3d::visualization::gui::FontDescription::ranges_

◆ SANS_SERIF

constexpr const char * open3d::visualization::gui::FontDescription::SANS_SERIF = "sans-serif"
staticconstexpr

◆ style_

FontStyle open3d::visualization::gui::FontDescription::style_

The documentation for this class was generated from the following files: