26 #if ! defined (octave_text_renderer_h)
27 #define octave_text_renderer_h 1
29 #include "octave-config.h"
41 class base_text_renderer;
64 Matrix get_extent (
const std::string& txt,
double rotation = 0.0,
67 void set_anti_aliasing (
bool val);
69 void set_font (
const std::string&
name,
const std::string& weight,
70 const std::string& angle,
double size);
74 void set_color (
const Matrix& c);
76 void text_to_pixels (
const std::string& txt,
78 int halign,
int valign,
double rotation = 0.0,
80 bool handle_rotation =
true);
87 :
name (), weight (), angle (), size (0)
90 font (
const std::string& nm,
const std::string& wt,
91 const std::string& ang,
double sz)
92 :
name (nm), weight (wt), angle (ang), size (sz)
96 :
name (ft.
name), weight (ft.weight), angle (ft.angle),
137 string (
const std::string& s,
font&
f,
const double x0,
const double y0)
138 : str (s), family (
f.get_name ()), fnt (
f),
x (x0), y (y0), z (0.0),
139 xdata (), code (0), color (
Matrix (1,3,0.0))
143 : str (s.str), family (s.family), fnt (s.fnt),
x (s.
x), y (s.y),
144 z (s.z), xdata (s.xdata), code (s.code), color (s.color)
149 string& operator = (
const string& s)
171 std::string
get_name (
void)
const {
return fnt.get_name (); }
177 std::string
get_weight (
void)
const {
return fnt.get_weight (); }
179 std::string
get_angle (
void)
const {
return fnt.get_angle (); }
181 double get_size (
void)
const {
return fnt.get_size (); }
187 void set_xdata (
const std::vector<double>& x0) { xdata = x0; }
189 std::vector<double>
get_xdata (
void)
const {
return xdata; }
191 void set_y (
const double y0) { y = y0; }
193 double get_y (
void)
const {
return y; }
195 void set_z (
const double z0) { z = z0; }
197 double get_z (
void)
const {
return z; }
205 color(0) =
static_cast<double> (c(0)) / 255;
206 color(1) =
static_cast<double> (c(1)) / 255;
207 color(2) =
static_cast<double> (c(2)) / 255;
223 void text_to_strlist (
const std::string& txt,
225 int halign,
int valign,
double rotation = 0.0,
std::string get_angle(void) const
double get_size(void) const
font(const std::string &nm, const std::string &wt, const std::string &ang, double sz)
std::string get_weight(void) const
std::string get_name(void) const
void set_family(const std::string &nm)
void set_string(const std::string &s)
std::vector< double > get_xdata(void) const
void set_code(const uint32_t c)
void set_xdata(const std::vector< double > &x0)
std::vector< double > xdata
double get_size(void) const
void set_z(const double z0)
std::string get_name(void) const
void set_y(const double y0)
std::string get_angle(void) const
std::string get_string(void) const
std::string get_weight(void) const
std::string get_family(void) const
uint32_t get_code(void) const
string(const std::string &s, font &f, const double x0, const double y0)
Matrix get_color(void) const
void set_x(const double x0)
void set_color(const uint8NDArray &c)
text_renderer(const text_renderer &)=delete
F77_RET_T const F77_DBLE * x
static double f(double k, double l_nu, double c_pm)
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=nullptr)