Magick++  7.1.0
TypeMetric.cpp
Go to the documentation of this file.
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 2001
4 //
5 // Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // TypeMetric implementation
9 //
10 
11 #define MAGICKCORE_IMPLEMENTATION 1
12 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
13 
14 #include "Magick++/TypeMetric.h"
15 #include "Magick++/Drawable.h"
16 #include <string.h>
17 
19 {
20  memset(&_typeMetric,0,sizeof(_typeMetric));
21 }
22 
24 {
25 }
26 
27 double Magick::TypeMetric::ascent(void) const
28 {
29  return(_typeMetric.ascent);
30 }
31 
33 {
34  return(Geometry((size_t) (_typeMetric.bounds.x2-_typeMetric.bounds.x1),
35  (size_t) (_typeMetric.bounds.y2-_typeMetric.bounds.y1),(ssize_t)
36  _typeMetric.bounds.x1,(ssize_t) _typeMetric.bounds.y1));
37 }
38 
39 double Magick::TypeMetric::descent(void) const
40 {
41  return(_typeMetric.descent);
42 }
43 
45 {
46  return(_typeMetric.max_advance);
47 }
48 
50 {
51  return(Coordinate(_typeMetric.origin.x,_typeMetric.origin.y));
52 }
53 
55 {
56  return(Coordinate(_typeMetric.pixels_per_em.x,_typeMetric.pixels_per_em.y));
57 }
58 
60 {
61  return(_typeMetric.height);
62 }
63 
65 {
66  return(_typeMetric.width);
67 }
68 
70 {
71  return(_typeMetric.underline_position);
72 }
73 
75 {
76  return(_typeMetric.underline_thickness);
77 }
double descent(void) const
Definition: TypeMetric.cpp:39
Coordinate pixelsPerEm(void) const
Definition: TypeMetric.cpp:54
double underlinePosition(void) const
Definition: TypeMetric.cpp:69
Geometry bounds(void) const
Definition: TypeMetric.cpp:32
double underlineThickness(void) const
Definition: TypeMetric.cpp:74
class MagickPPExport Geometry
Definition: Geometry.h:21
double textWidth(void) const
Definition: TypeMetric.cpp:64
double ascent(void) const
Definition: TypeMetric.cpp:27
double textHeight(void) const
Definition: TypeMetric.cpp:59
double maxHorizontalAdvance(void) const
Definition: TypeMetric.cpp:44
Coordinate origin(void) const
Definition: TypeMetric.cpp:49