GNU Octave  4.4.1
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) 2016-2018 John W. Eaton
4 Copyright (C) 2009-2018 Michael Goffioul
5 
6 This file is part of Octave.
7 
8 Octave is free software: you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_base_text_renderer_h)
25 #define octave_base_text_renderer_h 1
26 
27 #include "octave-config.h"
28 
29 #include <list>
30 #include <string>
31 
32 #include "dMatrix.h"
33 #include "uint8NDArray.h"
34 
35 #include "text-renderer.h"
36 #include "txt-eng.h"
37 
38 namespace octave
39 {
40  class
42  {
43  public:
44 
46 
47  // No copying!
48 
49  base_text_renderer (const base_text_renderer&) = delete;
50 
51  base_text_renderer& operator = (const base_text_renderer&) = delete;
52 
53  virtual ~base_text_renderer (void) = default;
54 
55  virtual Matrix
56  get_extent (text_element *elt, double rotation) = 0;
57 
58  virtual Matrix
59  get_extent (const std::string& txt, double rotation,
60  const caseless_str& interpreter) = 0;
61 
62  virtual void
63  set_font (const std::string& name, const std::string& weight,
64  const std::string& angle, double size) = 0;
65 
66  virtual void set_color (const Matrix& c) = 0;
67 
68  virtual void
69  text_to_pixels (const std::string& txt, uint8NDArray& pxls,
70  Matrix& bbox, int halign, int valign, double rotation,
72  bool handle_rotation) = 0;
73 
74  virtual void
75  text_to_strlist (const std::string& txt,
76  std::list<text_renderer::string>& lst,
77  Matrix& box, int halign, int valign, double rotation,
78  const caseless_str& interpreter = "tex") = 0;
79  };
80 }
81 
82 #endif
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
nd deftypefn *std::string name
Definition: sysdep.cc:647
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=nullptr)
Definition: dMatrix.h:36
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888