SplashFTFontEngine.h 2.72 KB
Newer Older
Kristian Høgsberg's avatar
Kristian Høgsberg committed
1 2 3 4 5 6
//========================================================================
//
// SplashFTFontEngine.h
//
//========================================================================

7 8 9 10
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
11 12 13
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
14
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
15
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
16
// Copyright (C) 2009, 2018 Albert Astals Cid <aacid@kde.org>
17
// Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
18
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
19
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
20 21 22 23 24 25
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================

Kristian Høgsberg's avatar
Kristian Høgsberg committed
26 27 28 29 30 31 32 33 34 35 36 37 38
#ifndef SPLASHFTFONTENGINE_H
#define SPLASHFTFONTENGINE_H

#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif

#include <ft2build.h>
#include FT_FREETYPE_H
#include "goo/gtypes.h"

class SplashFontFile;
class SplashFontFileID;
39
class SplashFontSrc;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
40 41 42 43 44 45 46 47

//------------------------------------------------------------------------
// SplashFTFontEngine
//------------------------------------------------------------------------

class SplashFTFontEngine {
public:

48
  static SplashFTFontEngine *init(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHinting);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
49 50 51

  ~SplashFTFontEngine();

52 53 54
  SplashFTFontEngine(const SplashFTFontEngine&) = delete;
  SplashFTFontEngine& operator=(const SplashFTFontEngine&) = delete;

Kristian Høgsberg's avatar
Kristian Høgsberg committed
55
  // Load fonts.
56 57 58
  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
  SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
59
  SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
60 61
  SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src,
                                      int *codeToGID, int codeToGIDLen);
62
  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
63
				   int *codeToGID, int codeToGIDLen, int faceIndex = 0);
64 65
  GBool getAA() { return aa; }
  void setAA(GBool aaA) { aa = aaA; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
66 67 68

private:

69
  SplashFTFontEngine(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHintingA, FT_Library libA);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
70 71

  GBool aa;
72
  GBool enableFreeTypeHinting;
73
  GBool enableSlightHinting;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
74
  FT_Library lib;
75
  GBool useCIDs;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
76 77 78 79 80 81

  friend class SplashFTFontFile;
  friend class SplashFTFont;
};

#endif