Open3D (C++ API)  0.17.0
Font.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <string>
11 #include <vector>
12 
14 
15 namespace open3d {
16 namespace visualization {
17 namespace gui {
18 
20 public:
21  constexpr static const char *SANS_SERIF = "sans-serif";
22  constexpr static const char *MONOSPACE = "monospace";
23 
38  explicit FontDescription(const char *typeface,
40  int point_size = 0);
41 
58  void AddTypefaceForLanguage(const char *typeface, const char *lang);
59 
62  void AddTypefaceForCodePoints(const char *typeface,
63  const std::vector<uint32_t> &code_points);
64 
65 public: // for internal use, use functions above to set
66  struct CPRange {
67  std::string path;
68  std::string lang;
69  std::vector<uint32_t> code_points; // empty if lang is not ""
70  };
71  std::vector<CPRange> ranges_;
74 };
75 
76 } // namespace gui
77 } // namespace visualization
78 } // namespace open3d
constexpr static const char * SANS_SERIF
Definition: Font.h:21
FontDescription(const char *typeface, FontStyle style=FontStyle::NORMAL, int point_size=0)
Definition: Font.cpp:18
constexpr static const char * MONOSPACE
Definition: Font.h:22
FontStyle style_
Definition: Font.h:72
std::vector< CPRange > ranges_
Definition: Font.h:71
void AddTypefaceForLanguage(const char *typeface, const char *lang)
Definition: Font.cpp:26
void AddTypefaceForCodePoints(const char *typeface, const std::vector< uint32_t > &code_points)
Definition: Font.cpp:31
FontStyle
Definition: Gui.h:70
Definition: PinholeCameraIntrinsic.cpp:16
std::vector< uint32_t > code_points
Definition: Font.h:69