GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
base-text-renderer.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2009-2025 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_base_text_renderer_h)
27#define octave_base_text_renderer_h 1
28
29#include "octave-config.h"
30
31#include <list>
32#include <string>
33
34#include "dMatrix.h"
35#include "oct-map.h"
36#include "uint8NDArray.h"
37
38#include "text-engine.h"
39#include "text-renderer.h"
40
42
44{
45public:
46
47 enum
48 {
49 ROTATION_0 = 0,
50 ROTATION_90 = 1,
51 ROTATION_180 = 2,
52 ROTATION_270 = 3
53 };
54
56
57 OCTAVE_DISABLE_COPY_MOVE (base_text_renderer)
58
59 virtual ~base_text_renderer () = default;
60
61 virtual void
62 set_anti_aliasing (bool val) = 0;
63
64 virtual Matrix
65 get_extent (text_element *elt, double rotation) = 0;
66
67 virtual Matrix
68 get_extent (const std::string& txt, double rotation,
69 const caseless_str& interpreter) = 0;
70
71 virtual void
72 set_font (const std::string& name, const std::string& weight,
73 const std::string& angle, double size) = 0;
74
75 virtual bool
76 ok () { return true; };
77
78 virtual octave_map
80
81 virtual void set_color (const Matrix& c) = 0;
82
83 virtual void
84 text_to_pixels (const std::string& txt, uint8NDArray& pxls,
85 Matrix& bbox, int halign, int valign, double rotation,
87 bool handle_rotation) = 0;
88
89 virtual void
90 text_to_strlist (const std::string& txt,
91 std::list<text_renderer::string>& lst,
92 Matrix& box, int halign, int valign, double rotation,
93 const caseless_str& interpreter = "tex") = 0;
94
95 void rotate_pixels (uint8NDArray& pixels, int rot_mode) const;
96
97 int rotation_to_mode (double rotation) const;
98
99 void fix_bbox_anchor (Matrix& bbox, int halign,
100 int valign, int rot_mode,
101 bool handle_rotation) const;
102
103};
104
105OCTAVE_END_NAMESPACE(octave)
106
107#endif
virtual void text_to_pixels(const std::string &txt, uint8NDArray &pxls, Matrix &bbox, int halign, int valign, double rotation, const caseless_str &interpreter, bool handle_rotation)=0
virtual void text_to_strlist(const std::string &txt, std::list< text_renderer::string > &lst, Matrix &box, int halign, int valign, double rotation, const caseless_str &interpreter="tex")=0
virtual void set_color(const Matrix &c)=0
virtual octave_map get_system_fonts()=0
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn