Mercurial > octave
comparison libgui/graphics/gl-select.cc @ 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 | 710e700cdd7f |
children | 40de9f8f23a6 |
comparison
equal
deleted
inserted
replaced
21208:f5e05c11c343 | 21209:67d2965af0b5 |
---|---|
185 Matrix | 185 Matrix |
186 opengl_selector::render_text (const std::string& txt, | 186 opengl_selector::render_text (const std::string& txt, |
187 double x, double y, double z, | 187 double x, double y, double z, |
188 int halign, int valign, double rotation) | 188 int halign, int valign, double rotation) |
189 { | 189 { |
190 #if HAVE_FREETYPE | |
191 uint8NDArray pixels; | 190 uint8NDArray pixels; |
192 Matrix bbox; | 191 Matrix bbox (1, 4, 0.0); |
193 | 192 |
194 // FIXME: probably more efficient to only compute bbox instead | 193 // FIXME: probably more efficient to only compute bbox instead |
195 // of doing full text rendering... | 194 // of doing full text rendering... |
196 text_to_pixels (txt, pixels, bbox, halign, valign, rotation); | 195 text_to_pixels (txt, pixels, bbox, halign, valign, rotation); |
197 fake_text (x, y, z, bbox, false); | 196 fake_text(x, y, z, bbox, false); |
198 | 197 |
199 return bbox; | 198 return bbox; |
200 #else | |
201 return Matrix (1, 4, 0.0); | |
202 #endif | |
203 } | 199 } |
204 | 200 |
205 void | 201 void |
206 opengl_selector::draw_image (const image::properties& props) | 202 opengl_selector::draw_image (const image::properties& props) |
207 { | 203 { |