~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/poppler/splash/SplashFontEngine.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//========================================================================
 
2
//
 
3
// SplashFontEngine.h
 
4
//
 
5
//========================================================================
 
6
 
 
7
//========================================================================
 
8
//
 
9
// Modified under the Poppler project - http://poppler.freedesktop.org
 
10
//
 
11
// All changes made under the Poppler project to this file are licensed
 
12
// under GPL version 2 or later
 
13
//
 
14
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
 
15
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
 
16
// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
 
17
//
 
18
// To see a description of the changes please see the Changelog file that
 
19
// came with your tarball or type make ChangeLog if you are building from git
 
20
//
 
21
//========================================================================
 
22
 
 
23
#ifndef SPLASHFONTENGINE_H
 
24
#define SPLASHFONTENGINE_H
 
25
 
 
26
#ifdef USE_GCC_PRAGMAS
 
27
#pragma interface
 
28
#endif
 
29
 
 
30
#include "goo/gtypes.h"
 
31
 
 
32
class SplashT1FontEngine;
 
33
class SplashFTFontEngine;
 
34
class SplashDTFontEngine;
 
35
class SplashDT4FontEngine;
 
36
class SplashFontFile;
 
37
class SplashFontFileID;
 
38
class SplashFont;
 
39
class SplashFontSrc;
 
40
 
 
41
//------------------------------------------------------------------------
 
42
 
 
43
#define splashFontCacheSize 16
 
44
 
 
45
//------------------------------------------------------------------------
 
46
// SplashFontEngine
 
47
//------------------------------------------------------------------------
 
48
 
 
49
class SplashFontEngine {
 
50
public:
 
51
 
 
52
  // Create a font engine.
 
53
  SplashFontEngine(
 
54
#if HAVE_T1LIB_H
 
55
                   GBool enableT1lib,
 
56
#endif
 
57
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
 
58
                   GBool enableFreeType,
 
59
                   GBool enableFreeTypeHinting,
 
60
#endif
 
61
                   GBool aa);
 
62
 
 
63
  ~SplashFontEngine();
 
64
 
 
65
  // Get a font file from the cache.  Returns NULL if there is no
 
66
  // matching entry in the cache.
 
67
  SplashFontFile *getFontFile(SplashFontFileID *id);
 
68
 
 
69
  // Load fonts - these create new SplashFontFile objects.
 
70
  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
 
71
  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
 
72
  SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
 
73
  SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
 
74
  SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src);
 
75
  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
 
76
                                   Gushort *codeToGID, int codeToGIDLen, int faceIndex = 0);
 
77
 
 
78
  // Get a font - this does a cache lookup first, and if not found,
 
79
  // creates a new SplashFont object and adds it to the cache.  The
 
80
  // matrix, mat = textMat * ctm:
 
81
  //    [ mat[0] mat[1] ]
 
82
  //    [ mat[2] mat[3] ]
 
83
  // specifies the font transform in PostScript style:
 
84
  //    [x' y'] = [x y] * mat
 
85
  // Note that the Splash y axis points downward.
 
86
  SplashFont *getFont(SplashFontFile *fontFile,
 
87
                      SplashCoord *textMat, SplashCoord *ctm);
 
88
 
 
89
private:
 
90
 
 
91
  SplashFont *fontCache[splashFontCacheSize];
 
92
 
 
93
#if HAVE_T1LIB_H
 
94
  SplashT1FontEngine *t1Engine;
 
95
#endif
 
96
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
 
97
  SplashFTFontEngine *ftEngine;
 
98
#endif
 
99
};
 
100
 
 
101
#endif