Magick++  7.0.10
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 // Copyright Dirk Lemstra 2014-2018
5 //
6 // TypeMetric implementation
7 //
8 
9 #define MAGICKCORE_IMPLEMENTATION 1
10 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
11 
12 #include "Magick++/TypeMetric.h"
13 #include "Magick++/Drawable.h"
14 #include <string.h>
15 
17 {
18  memset(&_typeMetric,0,sizeof(_typeMetric));
19 }
20 
22 {
23 }
24 
25 double Magick::TypeMetric::ascent(void) const
26 {
27  return(_typeMetric.ascent);
28 }
29 
31 {
32  return(Geometry((size_t) (_typeMetric.bounds.x2-_typeMetric.bounds.x1),
33  (size_t) (_typeMetric.bounds.y2-_typeMetric.bounds.y1),(ssize_t)
34  _typeMetric.bounds.x1,(ssize_t) _typeMetric.bounds.y1));
35 }
36 
37 double Magick::TypeMetric::descent(void) const
38 {
39  return(_typeMetric.descent);
40 }
41 
43 {
44  return(_typeMetric.max_advance);
45 }
46 
48 {
49  return(Coordinate(_typeMetric.origin.x,_typeMetric.origin.y));
50 }
51 
53 {
54  return(Coordinate(_typeMetric.pixels_per_em.x,_typeMetric.pixels_per_em.y));
55 }
56 
58 {
59  return(_typeMetric.height);
60 }
61 
63 {
64  return(_typeMetric.width);
65 }
66 
68 {
69  return(_typeMetric.underline_position);
70 }
71 
73 {
74  return(_typeMetric.underline_thickness);
75 }
double descent(void) const
Definition: TypeMetric.cpp:37
Coordinate pixelsPerEm(void) const
Definition: TypeMetric.cpp:52
double underlinePosition(void) const
Definition: TypeMetric.cpp:67
Geometry bounds(void) const
Definition: TypeMetric.cpp:30
double underlineThickness(void) const
Definition: TypeMetric.cpp:72
class MagickPPExport Geometry
Definition: Geometry.h:19
double textWidth(void) const
Definition: TypeMetric.cpp:62
double ascent(void) const
Definition: TypeMetric.cpp:25
double textHeight(void) const
Definition: TypeMetric.cpp:57
double maxHorizontalAdvance(void) const
Definition: TypeMetric.cpp:42
Coordinate origin(void) const
Definition: TypeMetric.cpp:47