26 #if ! defined (octave_text_renderer_h)
27 #define octave_text_renderer_h 1
29 #include "octave-config.h"
60 Matrix get_extent (
const std::string& txt,
double rotation = 0.0,
63 void set_anti_aliasing (
bool val);
65 void set_font (
const std::string& name,
const std::string& weight,
66 const std::string& angle,
double size);
70 void set_color (
const Matrix& c);
72 void text_to_pixels (
const std::string& txt,
74 int halign,
int valign,
double rotation = 0.0,
76 bool handle_rotation =
true);
83 : m_name (), m_weight (), m_angle (), m_size (0)
86 font (
const std::string& nm,
const std::string& wt,
87 const std::string& ang,
double sz)
88 : m_name (nm), m_weight (wt), m_angle (ang), m_size (sz)
92 : m_name (ft.m_name), m_weight (ft.m_weight), m_angle (ft.m_angle),
136 : m_str (s), m_family (
f.get_name ()), m_fnt (
f), m_x (
x), m_y (y),
137 m_z (0.0), m_xdata (), m_code (0), m_color (
Matrix (1, 3, 0.0)),
141 OCTAVE_DEFAULT_COPY_MOVE_DELETE (
string)
143 void set_string (const std::
string& s) { m_str = s; }
147 std::string
get_name ()
const {
return m_fnt.get_name (); }
153 std::string
get_weight ()
const {
return m_fnt.get_weight (); }
155 std::string
get_angle ()
const {
return m_fnt.get_angle (); }
157 double get_size ()
const {
return m_fnt.get_size (); }
161 double get_x ()
const {
return m_x; }
165 std::vector<double>
get_xdata ()
const {
return m_xdata; }
167 void set_y (
const double y) { m_y = y; }
169 double get_y ()
const {
return m_y; }
171 void set_z (
const double z) { m_z = z; }
173 double get_z ()
const {
return m_z; }
175 void set_code (
const uint32_t code) { m_code = code; }
185 m_color(0) =
static_cast<double> (c(0)) / 255;
186 m_color(1) =
static_cast<double> (c(1)) / 255;
187 m_color(2) =
static_cast<double> (c(2)) / 255;
195 std::string m_family;
197 double m_x, m_y, m_z;
198 std::vector<double> m_xdata;
201 std::string m_svg_element;
204 void text_to_strlist (
const std::string& txt,
205 std::list<string>& lst,
Matrix& box,
206 int halign,
int valign,
double rotation = 0.0,
215 OCTAVE_END_NAMESPACE(
octave)
std::string get_angle() const
font(const std::string &nm, const std::string &wt, const std::string &ang, double sz)
std::string get_weight() const
std::string get_name() const
void set_z(const double z)
std::string get_string() const
void set_svg_element(const std::string &svg)
void set_xdata(const std::vector< double > &x)
std::string get_angle() const
void set_y(const double y)
std::vector< double > get_xdata() const
uint32_t get_code() const
std::string get_weight() const
string(const std::string &s, const font &f, double x, double y)
void set_x(const double x)
std::string get_svg_element() const
void set_family(const std::string &nm)
std::string get_family() const
std::string get_name() const
void set_code(const uint32_t code)
void set_color(const uint8NDArray &c)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f