Mercurial > octave-libtiff
comparison libinterp/corefcn/gl-render.h @ 21209:67d2965af0b5
revamp text rendering classes
* base-text-renderer.h: New file.
* ft-text-renderer.h, ft-text-renderer.cc: New files for freetype text
rendering classes, adapted from txt-eng-ft.h and txt-eng.cc.
* text-renderer.h, text-renderer.cc: New files. Public interface for
text rendering.
* gl-select.cc, gl-render.cc, gl-render.h, gl2ps-print.cc,
graphics.cc, graphics.in.h: Adapt to use new text rendering interface
that does not require checking HAVE_FREETYPE.
* libinterp/corefcn/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 06 Feb 2016 08:15:53 -0500 |
parents | 1adcdc518d9e |
children | 1473547f50f5 |
comparison
equal
deleted
inserted
replaced
21208:f5e05c11c343 | 21209:67d2965af0b5 |
---|---|
23 #if ! defined (octave_gl_render_h) | 23 #if ! defined (octave_gl_render_h) |
24 #define octave_gl_render_h 1 | 24 #define octave_gl_render_h 1 |
25 | 25 |
26 #include "graphics.h" | 26 #include "graphics.h" |
27 #include "oct-opengl.h" | 27 #include "oct-opengl.h" |
28 #include "txt-eng-ft.h" | 28 #include "text-renderer.h" |
29 | 29 |
30 #if defined (HAVE_OPENGL) | 30 #if defined (HAVE_OPENGL) |
31 | 31 |
32 class | 32 class |
33 OCTINTERP_API | 33 OCTINTERP_API |
35 { | 35 { |
36 public: | 36 public: |
37 opengl_renderer (void) | 37 opengl_renderer (void) |
38 : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), | 38 : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), |
39 zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), | 39 zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), |
40 camera_pos (), camera_dir (), interpreter ("none") | 40 camera_pos (), camera_dir (), interpreter ("none"), txt_renderer () |
41 #if HAVE_FREETYPE | |
42 , text_renderer () | |
43 #endif | |
44 { } | 41 { } |
45 | 42 |
46 virtual ~opengl_renderer (void) { } | 43 virtual ~opengl_renderer (void) { } |
47 | 44 |
48 virtual void draw (const graphics_object& go, bool toplevel = true); | 45 virtual void draw (const graphics_object& go, bool toplevel = true); |
103 Matrix& bbox, | 100 Matrix& bbox, |
104 int halign = 0, int valign = 0, | 101 int halign = 0, int valign = 0, |
105 double rotation = 0.0); | 102 double rotation = 0.0); |
106 | 103 |
107 virtual void text_to_strlist (const std::string& txt, | 104 virtual void text_to_strlist (const std::string& txt, |
108 std::list<ft_render::ft_string>& lst, | 105 std::list<text_renderer::string>& lst, |
109 Matrix& bbox, | 106 Matrix& bbox, |
110 int halign = 0, int valign = 0, | 107 int halign = 0, int valign = 0, |
111 double rotation = 0.0); | 108 double rotation = 0.0); |
112 | 109 |
113 virtual Matrix render_text (const std::string& txt, | 110 virtual Matrix render_text (const std::string& txt, |
193 ColumnVector camera_pos, camera_dir; | 190 ColumnVector camera_pos, camera_dir; |
194 | 191 |
195 // interpreter to be used by text_to_pixels | 192 // interpreter to be used by text_to_pixels |
196 caseless_str interpreter; | 193 caseless_str interpreter; |
197 | 194 |
198 #if HAVE_FREETYPE | 195 text_renderer txt_renderer; |
199 // FreeType render, used for text rendering | |
200 ft_render text_renderer; | |
201 #endif | |
202 | 196 |
203 private: | 197 private: |
204 class patch_tesselator; | 198 class patch_tesselator; |
205 }; | 199 }; |
206 | 200 |