Magick++ 7.1.1
Loading...
Searching...
No Matches
TypeMetric.h
1// This may look like C code, but it is really -*- C++ -*-
2//
3// Copyright Bob Friesenhahn, 2001, 2002
4//
5// Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6// dedicated to making software imaging solutions freely available.
7//
8// TypeMetric Definition
9//
10// Container for font type metrics
11//
12
13#if !defined (Magick_TypeMetric_header)
14#define Magick_TypeMetric_header
15
16#include "Magick++/Include.h"
17#include "Magick++/Drawable.h"
18
19namespace Magick
20{
21 class MagickPPExport TypeMetric
22 {
23 friend class Image;
24
25 public:
26
27 // Default constructor
28 TypeMetric(void);
29
30 // Destructor
31 ~TypeMetric(void);
32
33 // The distance in pixels from the text baseline to the highest/upper
34 // grid coordinate used to place an outline point.
35 double ascent(void) const;
36
37 // The bounds of the type metric.
38 Geometry bounds(void) const;
39
40 // The distance in pixels from the baseline to the lowest grid coordinate
41 // used to place an outline point. Always a negative value.
42 double descent(void) const;
43
44 // Maximum horizontal advance in pixels.
45 double maxHorizontalAdvance(void) const;
46
47 // The origin.
48 Coordinate origin(void) const;
49
50 // The number of pixels per em.
51 Coordinate pixelsPerEm(void) const;
52
53 // Text height in pixels.
54 double textHeight(void) const;
55
56 // Text width in pixels.
57 double textWidth(void) const;
58
59 // Underline position.
60 double underlinePosition(void) const;
61
62 // Underline thickness.
63 double underlineThickness(void) const;
64
65 private:
66 MagickCore::TypeMetric _typeMetric;
67 };
68} // namespace Magick
69
70#endif // Magick_TypeMetric_header