GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
base-text-renderer.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2009-2021 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 
41 namespace octave
42 {
43  class
45  {
46  public:
47 
49 
50  // No copying!
51 
53 
54  base_text_renderer& operator = (const base_text_renderer&) = delete;
55 
56  virtual ~base_text_renderer (void) = default;
57 
58  virtual void
59  set_anti_aliasing (bool val) = 0;
60 
61  virtual Matrix
62  get_extent (text_element *elt, double rotation) = 0;
63 
64  virtual Matrix
65  get_extent (const std::string& txt, double rotation,
66  const caseless_str& interpreter) = 0;
67 
68  virtual void
69  set_font (const std::string& name, const std::string& weight,
70  const std::string& angle, double size) = 0;
71 
72  virtual octave_map
73  get_system_fonts (void) = 0;
74 
75  virtual void set_color (const Matrix& c) = 0;
76 
77  virtual void
78  text_to_pixels (const std::string& txt, uint8NDArray& pxls,
79  Matrix& bbox, int halign, int valign, double rotation,
81  bool handle_rotation) = 0;
82 
83  virtual void
84  text_to_strlist (const std::string& txt,
85  std::list<text_renderer::string>& lst,
86  Matrix& box, int halign, int valign, double rotation,
87  const caseless_str& interpreter = "tex") = 0;
88  };
89 }
90 
91 #endif
Definition: dMatrix.h:42
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 ~base_text_renderer(void)=default
virtual octave_map get_system_fonts(void)=0
virtual Matrix get_extent(text_element *elt, double rotation)=0
virtual void set_anti_aliasing(bool val)=0
virtual Matrix get_extent(const std::string &txt, double rotation, const caseless_str &interpreter)=0
virtual void set_color(const Matrix &c)=0
virtual void set_font(const std::string &name, const std::string &weight, const std::string &angle, double size)=0
base_text_renderer(const base_text_renderer &)=delete
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
QString name
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=nullptr)