annotate libinterp/corefcn/txt-eng-ft.h @ 20945:9d9270e2f98f

eliminate comments after preprocessor conditionals * annotation-dialog.h, gl-select.h, documentation-dock-widget.h, files-dock-widget.h, find-files-dialog.h, find-files-model.h, history-dock-widget.h, file-editor-interface.h, file-editor.h, find-dialog.h, main-window.h, resource-manager.h, settings-dialog.h, shortcut-manager.h, terminal-dock-widget.h, welcome-wizard.h, defun-int.h, gl2ps-renderer.h, load-save.cc, ls-hdf5.cc, ls-mat5.cc, octave-link.h, sighandlers.cc, txt-eng-ft.cc, txt-eng-ft.h, zfstream.cc, zfstream.h, ov-cx-mat.cc, ov-cx-sparse.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-java.cc, ov-re-mat.cc, ov-re-sparse.cc, Sparse-diag-op-defs.h, Sparse-perm-op-defs.h, oct-env.cc, oct-refcount.h, sparse-util.cc, statdefs.h, main.in.cc: Eliminate comments after preprocessor conditionals.
author John W. Eaton <jwe@octave.org>
date Fri, 18 Dec 2015 22:06:22 -0500
parents 5b7643257978
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
1 /*
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 18736
diff changeset
3 Copyright (C) 2009-2015 Michael Goffioul
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
4
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
5 This file is part of Octave.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
6
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
10 option) any later version.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
11
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
15 for more details.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
16
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
20
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
21 */
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
22
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
23 #if ! defined (txt_eng_ft_h)
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
24 #define txt_eng_ft_h 1
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
25
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
26 #if HAVE_FREETYPE
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
27
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
28 #include <list>
12969
6fc2c61660f2 Native multi-line text alignment.
Vanya Sergeev <vsergeev@gmail.com>
parents: 12334
diff changeset
29 #include <vector>
6fc2c61660f2 Native multi-line text alignment.
Vanya Sergeev <vsergeev@gmail.com>
parents: 12334
diff changeset
30
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
31 #include <ft2build.h>
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
32 #include FT_FREETYPE_H
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
33
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
34 #include <dMatrix.h>
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
35 #include <uint8NDArray.h>
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
36 #include "txt-eng.h"
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
37
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
38 class
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
39 OCTINTERP_API
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
40 ft_render : public text_processor
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
41 {
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
42 public:
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
43 enum
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
44 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
45 MODE_BBOX = 0,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
46 MODE_RENDER = 1
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
47 };
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
48
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
49 enum
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
50 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
51 ROTATION_0 = 0,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
52 ROTATION_90 = 1,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
53 ROTATION_180 = 2,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
54 ROTATION_270 = 3
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
55 };
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
56
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
57 public:
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
58
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
59 ft_render (void);
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
60
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
61 ~ft_render (void);
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
62
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
63 void visit (text_element_string& e);
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
64
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
65 void visit (text_element_list& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
66
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
67 void visit (text_element_subscript& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
68
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
69 void visit (text_element_superscript& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
70
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
71 void visit (text_element_color& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
72
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
73 void visit (text_element_fontsize& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
74
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
75 void visit (text_element_fontname& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
76
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
77 void visit (text_element_fontstyle& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
78
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
79 void visit (text_element_symbol& e);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
80
17274
0a09d4b40767 Combine successive TeX super- and subscript elements.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17272
diff changeset
81 void visit (text_element_combined& e);
0a09d4b40767 Combine successive TeX super- and subscript elements.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17272
diff changeset
82
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
83 void reset (void);
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
84
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
85 uint8NDArray get_pixels (void) const { return pixels; }
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
86
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
87 Matrix get_boundingbox (void) const { return bbox; }
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
88
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
89 uint8NDArray render (text_element* elt, Matrix& box,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 9403
diff changeset
90 int rotation = ROTATION_0);
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
91
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10313
diff changeset
92 Matrix get_extent (text_element *elt, double rotation = 0.0);
17269
5b088598df1d Add simple TeX parser based on flex/bison.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16892
diff changeset
93 Matrix get_extent (const std::string& txt, double rotation = 0.0,
5b088598df1d Add simple TeX parser based on flex/bison.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16892
diff changeset
94 const caseless_str& interpreter = "tex");
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10313
diff changeset
95
11455
2be9e22796d2 improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents: 10402
diff changeset
96 void set_font (const std::string& name, const std::string& weight,
2be9e22796d2 improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents: 10402
diff changeset
97 const std::string& angle, double size);
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
98
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
99 void set_color (Matrix c);
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
100
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
101 void set_mode (int m);
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
102
11455
2be9e22796d2 improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents: 10402
diff changeset
103 void text_to_pixels (const std::string& txt,
2be9e22796d2 improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents: 10402
diff changeset
104 uint8NDArray& pixels_, Matrix& bbox,
17269
5b088598df1d Add simple TeX parser based on flex/bison.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16892
diff changeset
105 int halign, int valign, double rotation,
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
106 const caseless_str& interpreter = "tex",
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
107 bool handle_rotation = true);
11455
2be9e22796d2 improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents: 10402
diff changeset
108
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
109 private:
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10313
diff changeset
110 int rotation_to_mode (double rotation) const;
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10313
diff changeset
111
12122
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
112 // No copying!
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
113
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
114 ft_render (const ft_render&);
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
115
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
116 ft_render& operator = (const ft_render&);
f4689107dd8c Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11586
diff changeset
117
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
118 // Class to hold information about fonts and a strong
18736
333901476119 maint: Use "FreeType" rather than "freetype" in messages and comments.
Rik <rik@octave.org>
parents: 17787
diff changeset
119 // reference to the font objects loaded by FreeType.
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
120 class ft_font
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
121 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
122 public:
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
123 ft_font (void)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
124 : name (), weight (), angle (), size (0), face (0) { }
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
125
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
126 ft_font (const std::string& nm, const std::string& wt,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
127 const std::string& ang, double sz, FT_Face f = 0)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
128 : name (nm), weight (wt), angle (ang), size (sz), face (f) { }
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
129
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
130 ft_font (const ft_font& ft);
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
131
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
132 ~ft_font (void)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
133 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
134 if (face)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
135 FT_Done_Face (face);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
136 }
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
137
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
138 ft_font& operator = (const ft_font& ft);
17330
219552139c18 Allow to compile with older freetype on RHEL5 (bug #39823).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17274
diff changeset
139
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
140 bool is_valid (void) const { return get_face (); }
17330
219552139c18 Allow to compile with older freetype on RHEL5 (bug #39823).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17274
diff changeset
141
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
142 std::string get_name (void) const { return name; }
17330
219552139c18 Allow to compile with older freetype on RHEL5 (bug #39823).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17274
diff changeset
143
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
144 std::string get_weight (void) const { return weight; }
17330
219552139c18 Allow to compile with older freetype on RHEL5 (bug #39823).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17274
diff changeset
145
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
146 std::string get_angle (void) const { return angle; }
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
147
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
148 double get_size (void) const { return size; }
17330
219552139c18 Allow to compile with older freetype on RHEL5 (bug #39823).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17274
diff changeset
149
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
150 FT_Face get_face (void) const;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
151
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
152 private:
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
153 std::string name;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
154 std::string weight;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
155 std::string angle;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
156 double size;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
157 mutable FT_Face face;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 };
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
159
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
160 void push_new_line (void);
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
161
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
162 void update_line_bbox (void);
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
163
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
164 void compute_bbox (void);
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
165
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
166 int compute_line_xoffset (const Matrix& lb) const;
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
167
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
168 FT_UInt process_character (FT_ULong code, FT_UInt previous = 0);
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
169
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
170 public:
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
171 // A class to store informations on substrings after parsing.
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
172 class ft_string : public ft_font
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
173 {
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
174 public:
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
175 ft_string (const std::string s, const std::string fontang,
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
176 const std::string fontwgt, const std::string nm,
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
177 const double fontsz, const double x0, const double y0)
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
178 : ft_font (nm, fontwgt, fontang, fontsz),
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
179 string(s), x(x0), y(y0), z(0.0), code(0),
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
180 color(Matrix (1,3,0.0)){ }
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
181
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
182 void set_string (const std::string str) { string = str; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
183
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
184 std::string get_string (void) const { return string; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
185
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
186 void set_x (const double x0) { x = x0; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
187
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
188 double get_x (void) const { return x; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
189
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
190 void set_y (const double y0) { y = y0; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
191
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
192 double get_y (void) const { return y; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
193
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
194 void set_z (const double z0) { z = z0; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
195
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
196 double get_z (void) const { return z; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
197
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
198 void set_code (const uint32_t c) { code = c; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
199
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
200 uint32_t get_code (void) const { return code; }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
201
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
202 void set_color (const uint8NDArray c)
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
203 {
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
204 color(0) = static_cast<double> (c(0)) / 255;
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
205 color(1) = static_cast<double> (c(1)) / 255;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
206 color(2) = static_cast<double> (c(2)) / 255;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
207 }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
208
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
209 Matrix get_color (void) const { return color; }
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
210
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
211 private:
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
212 std::string string;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
213 double x, y, z;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
214 uint32_t code;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
215 Matrix color;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
216 };
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
217
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
218 void text_to_strlist (const std::string& txt,
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
219 std::list<ft_string>& lst, Matrix& box,
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
220 int ha, int va, double rot,
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
221 const caseless_str& interp = "tex")
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
222 {
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
223 uint8NDArray pixels_;
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
224 // First run text_to_pixels which will also build the string list
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
225 text_to_pixels (txt, pixels_, box, ha, va, rot, interp, false);
20715
5b7643257978 Remove trailing whitespace at end of lines.
Rik <rik@octave.org>
parents: 20622
diff changeset
226
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
227 lst = strlist;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
228 }
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
229
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10313
diff changeset
230 private:
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
231 // The current font used by the renderer.
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
232 ft_font font;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
233
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
234 // Used to stored the bounding box corresponding to the rendered text.
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
235 // The bounding box has the form [x, y, w, h] where x and y represent the
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
236 // coordinates of the bottom left corner relative to the anchor point of
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
237 // the text (== start of text on the baseline). Due to font descent or
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
238 // multiple lines, the value y is usually negative.
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
239 Matrix bbox;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
240
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
241 // Used to stored the rendered text. It's a 3D matrix with size MxNx4
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
242 // where M and N are the width and height of the bounding box.
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
243 uint8NDArray pixels;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
244
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
245 // Used to store the bounding box of each line. This is used to layout
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
246 // multiline text properly.
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
247 std::list<Matrix> line_bbox;
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
248
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
249 // The current horizontal alignment. This is used to align multi-line text.
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
250 int halign;
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
251
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
252 // The X offset for the next glyph.
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
253 int xoffset;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
254
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
255 // The Y offset of the baseline for the current line.
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
256 int line_yoffset;
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
257
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
258 // The Y offset of the baseline for the next glyph. The offset is relative
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
259 // to line_yoffset. The total Y offset is computed with:
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
260 // line_yoffset + yoffset.
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
261 int yoffset;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
262
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
263 // The current mode of the rendering process (box computing or rendering).
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
264 int mode;
17271
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
265
cb7233cfbf43 Prepare base text rendering code for full TeX support.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17269
diff changeset
266 // The base color of the rendered text.
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17271
diff changeset
267 uint8NDArray color;
20622
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
268
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
269 // A list of parsed strings to be used for printing.
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
270 std::list<ft_string> strlist;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
271
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
272 // The X offset of the baseline for the current line.
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
273 int line_xoffset;
caa5dabc7913 Let the freetype renderer return a list of parsed substrings (bug #31468)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19697
diff changeset
274
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
275 };
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
276
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 20715
diff changeset
277 #endif
9403
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
278
4af6e29449c1 [mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
279 #endif