File: TypeMetric.cpp

package info (click to toggle)
imagemagick 6:6.0.6.2-2.9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,284 kB
  • ctags: 14,844
  • sloc: ansic: 190,790; cpp: 17,203; sh: 8,740; perl: 4,190; makefile: 1,740; tcl: 459
file content (52 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 2001
//
// TypeMetric implementation
//

#define MAGICK_IMPLEMENTATION

#include "Magick++/TypeMetric.h"
#include <string.h>

// Default constructor
Magick::TypeMetric::TypeMetric ( void )
{
  memset( &_typeMetric, 0, sizeof(_typeMetric));
}

Magick::TypeMetric::~TypeMetric ( void )
{
  // Nothing to do
}

// Ascent, expressed in pixels
double Magick::TypeMetric::ascent ( void ) const
{
  return _typeMetric.ascent;
}

// Descent, expressed in pixels
double Magick::TypeMetric::descent ( void ) const
{
  return _typeMetric.descent;
}

// Text width, expressed in pixels
double Magick::TypeMetric::textWidth ( void ) const
{
  return _typeMetric.width;
}

// Text height, expressed in pixels
double Magick::TypeMetric::textHeight ( void ) const
{
  return _typeMetric.height;
}

// Maximum horizontal advance, expressed in pixels
double Magick::TypeMetric::maxHorizontalAdvance ( void ) const
{
  return _typeMetric.max_advance;
}