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
16 Magick::TypeMetric::TypeMetric(void)
17 {
18 memset(&_typeMetric,0,sizeof(_typeMetric));
19 }
20
21 Magick::TypeMetric::~TypeMetric(void)
22 {
23 }
24
25 double Magick::TypeMetric::ascent(void) const
26 {
27 return(_typeMetric.ascent);
28 }
29
30 Magick::Geometry Magick::TypeMetric::bounds(void) const
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
42 double Magick::TypeMetric::maxHorizontalAdvance(void) const
43 {
44 return(_typeMetric.max_advance);
45 }
46
47 Magick::Coordinate Magick::TypeMetric::origin(void) const
48 {
49 return(Coordinate(_typeMetric.origin.x,_typeMetric.origin.y));
50 }
51
52 Magick::Coordinate Magick::TypeMetric::pixelsPerEm(void) const
53 {
54 return(Coordinate(_typeMetric.pixels_per_em.x,_typeMetric.pixels_per_em.y));
55 }
56
57 double Magick::TypeMetric::textHeight(void) const
58 {
59 return(_typeMetric.height);
60 }
61
62 double Magick::TypeMetric::textWidth(void) const
63 {
64 return(_typeMetric.width);
65 }
66
67 double Magick::TypeMetric::underlinePosition(void) const
68 {
69 return(_typeMetric.underline_position);
70 }
71
72 double Magick::TypeMetric::underlineThickness(void) const
73 {
74 return(_typeMetric.underline_thickness);
75 }
Magick::TypeMetric::descent
double descent(void) const
Definition: TypeMetric.cpp:37
Magick::TypeMetric::pixelsPerEm
Coordinate pixelsPerEm(void) const
Definition: TypeMetric.cpp:52
Magick::TypeMetric::underlinePosition
double underlinePosition(void) const
Definition: TypeMetric.cpp:67
TypeMetric.h
Magick::Coordinate
Definition: Drawable.h:46
Drawable.h
Magick::TypeMetric::bounds
Geometry bounds(void) const
Definition: TypeMetric.cpp:30
Magick::TypeMetric::underlineThickness
double underlineThickness(void) const
Definition: TypeMetric.cpp:72
Magick::Geometry
class MagickPPExport Geometry
Definition: Geometry.h:19
Magick::Geometry
Definition: Geometry.h:35
Magick::TypeMetric::textWidth
double textWidth(void) const
Definition: TypeMetric.cpp:62
Magick::TypeMetric::ascent
double ascent(void) const
Definition: TypeMetric.cpp:25
Magick::TypeMetric::textHeight
double textHeight(void) const
Definition: TypeMetric.cpp:57
Magick::TypeMetric::maxHorizontalAdvance
double maxHorizontalAdvance(void) const
Definition: TypeMetric.cpp:42
Magick::TypeMetric::~TypeMetric
~TypeMetric(void)
Definition: TypeMetric.cpp:21
Magick::TypeMetric::TypeMetric
TypeMetric(void)
Definition: TypeMetric.cpp:16
Magick::TypeMetric::origin
Coordinate origin(void) const
Definition: TypeMetric.cpp:47