ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Font.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
10 namespace cloudViewer {
11 namespace visualization {
12 namespace gui {
13 
14 // assigned in header in constexpr declaration, but still need to be defined
15 constexpr const char *FontDescription::SANS_SERIF;
16 constexpr const char *FontDescription::MONOSPACE;
17 
18 FontDescription::FontDescription(const char *typeface,
19  FontStyle style /*= FontStyle::NORMAL*/,
20  int point_size /*= 0*/) {
21  ranges_.push_back({typeface, "en", {}});
22  style_ = style;
23  point_size_ = point_size;
24 }
25 
26 void FontDescription::AddTypefaceForLanguage(const char *typeface,
27  const char *lang) {
28  ranges_.push_back({typeface, lang, {}});
29 }
30 
32  const char *typeface, const std::vector<uint32_t> &code_points) {
33  ranges_.push_back({typeface, "", code_points});
34 }
35 
36 } // namespace gui
37 } // namespace visualization
38 } // namespace cloudViewer
constexpr static const char * MONOSPACE
Definition: Font.h:23
FontDescription(const char *typeface, FontStyle style=FontStyle::NORMAL, int point_size=0)
Definition: Font.cpp:18
void AddTypefaceForCodePoints(const char *typeface, const std::vector< uint32_t > &code_points)
Definition: Font.cpp:31
void AddTypefaceForLanguage(const char *typeface, const char *lang)
Definition: Font.cpp:26
constexpr static const char * SANS_SERIF
Definition: Font.h:22
Generic file read and write utility for python interface.