ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Font.h
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 
8 #pragma once
9 
10 #include <cstdint>
11 #include <string>
12 #include <vector>
13 
14 #include "visualization/gui/Gui.h"
15 
16 namespace cloudViewer {
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 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.