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