Visual Computing Library
Loading...
Searching...
No Matches
text_manager.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_BGFX_TEXT_TEXT_MANAGER_H
24#define VCL_BGFX_TEXT_TEXT_MANAGER_H
25
26#include "embedded_fonts/embedded_font.h"
27#include "font/text_buffer_manager.h"
28
29#include <vclib/space/core/color.h>
30
31#include <string>
32
33namespace vcl {
34
36{
37 bgfx::TextBufferManager* mTextBufferManager = nullptr;
38 bgfx::TextBufferHandle mStaticText;
39 bgfx::TextBufferHandle mTransientText;
40
41 bgfx::FontHandle mCurrentFont = BGFX_INVALID_HANDLE;
42
43public:
46
47 void init();
48
49 void loadFont(const std::string& filePath, const std::string& fontName);
50
51 void clear();
52
53 void setCurrentFont(VclFont::Enum font, uint16_t fontSize);
54 void setCurrentFont(const std::string& fontName, uint16_t fontSize);
55
56 void appendTransientText(
57 const vcl::Point2f& pos,
58 const std::string& text,
59 const vcl::Color& color = vcl::Color::Black);
60
61 void appendStaticText(
62 const vcl::Point2f& pos,
63 const std::string& text,
64 const vcl::Color& color = vcl::Color::Black);
65
66 void submit(uint viewId);
67};
68
69} // namespace vcl
70
71#endif // VCL_BGFX_TEXT_TEXT_MANAGER_H
The Color class represents a 32 bit color.
Definition color.h:48
The Point class represents an N-dimensional point containing N scalar values.
Definition point.h:58
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Definition text_manager.h:36