Magick++: TypeMetric.cpp Source File

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