13 #include <pango/pango.h>
17 class FreetypeGlyphMgr;
28 #if defined ( __VISUALC__ ) || defined ( _MSC_VER ) || defined ( __BORLANDC__ ) || defined ( __GNUC__ ) || defined ( __WATCOMC__ )
29 #define LASIDLLEXPORT __declspec( dllexport )
30 #define LASIDLLIMPORT __declspec( dllimport )
35 #elif defined ( __CYGWIN__ )
36 #define LASIDLLEXPORT __declspec( dllexport )
37 #define LASIDLLIMPORT __declspec( dllimport )
38 #elif defined ( __GNUC__ ) && __GNUC__ > 3
42 #define LASIDLLEXPORT __attribute__ ( ( visibility( "default" ) ) )
52 #if defined(LASi_EXPORTS)
53 #define LASIDLLIMPEXP LASIDLLEXPORT
54 #define LASIDLLIMPEXP_DATA(type) LASIDLLEXPORT type
55 #elif defined(LASi_DLL)
56 #define LASIDLLIMPEXP LASIDLLIMPORT
57 #define LASIDLLIMPEXP_DATA(type) LASIDLLIMPORT type
60 #define LASIDLLIMPEXP_DATA(type) type
97 class PostscriptDocument;
98 class write_glyph_routine_to_stream;
121 static_cast<std::ostream&
>(os) << t;
142 const char*
const family =
"sans",
175 void write(std::ostream& os,
double llx=0,
double lly=0,
double urx=0,
double ury=0);
183 void get_dimensions(
const char* s,
double *lineSpacing,
double *xAdvance=NULL,
double *yMin=NULL,
double *yMax=NULL);
184 void get_dimensions(std::string s,
double *lineSpacing,
double *xAdvance=NULL,
double *yMin=NULL,
double *yMax=NULL);
194 return id1._str == id2._str;
198 return id1._str < id2._str;
202 GlyphId(FT_Face,
const FT_UInt);
205 std::string
str()
const {
return _str;}
214 typedef std::map<GlyphId, FreetypeGlyphMgr>
GlyphMap;
221 const GlyphMap::value_type&,
void* contextData);
223 void invoke_glyph_routine(
const GlyphMap::value_type&,
void* contextData);
225 void accrue_dimensions(
const GlyphMap::value_type&,
void* contextData);
229 void for_each_glyph_do(
const std::string&,
const GLYPH_FUNC,
void* contextData,
230 bool applyOffset =
false);
232 PangoContext* pangoContext()
const;
236 std::string glyphProcName()
const;
247 PangoContext* pangoCtx;
251 : os(os), pangoCtx(pangoCtx) {}
252 void operator()(PostscriptDocument::GlyphMap::value_type v);
258 static const unsigned int DRAWING_SCALE;
262 ContextMgr* _pContextMgr;
264 std::ostringstream _osHeader;
284 const char*
const family =
"sans",
289 : _family(family), _style(style), _weight(weight), _variant(variant), _stretch(stretch)
294 os.
doc().
setFont(_family, _style,_weight, _variant, _stretch);
298 const char*
const _family;
346 show(
const char* c_str ) : _str(c_str ) {}
347 show(std::string stl_str ) : _str(stl_str) {}