1
//----------------------------------------------------------------------------
2
// Anti-Grain Geometry - Version 2.4
3
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
5
// Permission to copy, use, modify, sell and distribute this software
6
// is granted provided this copyright notice appears in all copies.
7
// This software is provided "as is" without express or implied
8
// warranty, and with no claim as to its suitability for any purpose.
10
//----------------------------------------------------------------------------
11
// Contact: mcseem@antigrain.com
12
// mcseemagg@yahoo.com
13
// http://www.antigrain.com
14
//----------------------------------------------------------------------------
18
//----------------------------------------------------------------------------
20
#ifndef AGG_GSV_TEXT_INCLUDED
21
#define AGG_GSV_TEXT_INCLUDED
23
#include "agg_array.h"
24
#include "agg_conv_stroke.h"
25
#include "agg_conv_transform.h"
31
//---------------------------------------------------------------gsv_text
33
// See Implementation agg_gsv_text.cpp
48
void font(const void* font);
49
void flip(bool flip_y) { m_flip = flip_y; }
50
void load_font(const char* file);
51
void size(double height, double width=0.0);
52
void space(double space);
53
void line_space(double line_space);
54
void start_point(double x, double y);
55
void text(const char* text);
59
void rewind(unsigned path_id);
60
unsigned vertex(double* x, double* y);
63
// not supposed to be copied
64
gsv_text(const gsv_text&);
65
const gsv_text& operator = (const gsv_text&);
67
int16u value(const int8u* p) const
73
*((int8u*)&v + 1) = p[0];
78
*((int8u*)&v + 1) = p[1];
93
pod_array<char> m_text_buf;
96
pod_array<char> m_loaded_font;
111
//--------------------------------------------------------gsv_text_outline
112
template<class Transformer = trans_affine> class gsv_text_outline
115
gsv_text_outline(gsv_text& text, const Transformer& trans) :
117
m_trans(m_polyline, trans)
126
void transformer(const Transformer* trans)
128
m_trans->transformer(trans);
131
void rewind(unsigned path_id)
133
m_trans.rewind(path_id);
134
m_polyline.line_join(round_join);
135
m_polyline.line_cap(round_cap);
138
unsigned vertex(double* x, double* y)
140
return m_trans.vertex(x, y);
144
conv_stroke<gsv_text> m_polyline;
145
conv_transform<conv_stroke<gsv_text>, Transformer> m_trans;
1
//----------------------------------------------------------------------------
2
// Anti-Grain Geometry - Version 2.4
3
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
5
// Permission to copy, use, modify, sell and distribute this software
6
// is granted provided this copyright notice appears in all copies.
7
// This software is provided "as is" without express or implied
8
// warranty, and with no claim as to its suitability for any purpose.
10
//----------------------------------------------------------------------------
11
// Contact: mcseem@antigrain.com
12
// mcseemagg@yahoo.com
13
// http://www.antigrain.com
14
//----------------------------------------------------------------------------
18
//----------------------------------------------------------------------------
20
#ifndef AGG_GSV_TEXT_INCLUDED
21
#define AGG_GSV_TEXT_INCLUDED
23
#include "agg_array.h"
24
#include "agg_conv_stroke.h"
25
#include "agg_conv_transform.h"
31
//---------------------------------------------------------------gsv_text
33
// See Implementation agg_gsv_text.cpp
48
void font(const void* font);
49
void flip(bool flip_y) { m_flip = flip_y; }
50
void load_font(const char* file);
51
void size(double height, double width=0.0);
52
void space(double space);
53
void line_space(double line_space);
54
void start_point(double x, double y);
55
void text(const char* text);
59
void rewind(unsigned path_id);
60
unsigned vertex(double* x, double* y);
63
// not supposed to be copied
64
gsv_text(const gsv_text&);
65
const gsv_text& operator = (const gsv_text&);
67
int16u value(const int8u* p) const
73
*((int8u*)&v + 1) = p[0];
78
*((int8u*)&v + 1) = p[1];
93
pod_array<char> m_text_buf;
96
pod_array<char> m_loaded_font;
111
//--------------------------------------------------------gsv_text_outline
112
template<class Transformer = trans_affine> class gsv_text_outline
115
gsv_text_outline(gsv_text& text, Transformer& trans) :
117
m_trans(m_polyline, trans)
126
void transformer(const Transformer* trans)
128
m_trans->transformer(trans);
131
void rewind(unsigned path_id)
133
m_trans.rewind(path_id);
134
m_polyline.line_join(round_join);
135
m_polyline.line_cap(round_cap);
138
unsigned vertex(double* x, double* y)
140
return m_trans.vertex(x, y);
144
conv_stroke<gsv_text> m_polyline;
145
conv_transform<conv_stroke<gsv_text>, Transformer> m_trans;