Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-11 10:26:10

0001 //========================================================================
0002 //
0003 // SplashFontEngine.h
0004 //
0005 //========================================================================
0006 
0007 //========================================================================
0008 //
0009 // Modified under the Poppler project - http://poppler.freedesktop.org
0010 //
0011 // All changes made under the Poppler project to this file are licensed
0012 // under GPL version 2 or later
0013 //
0014 // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
0015 // Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
0016 // Copyright (C) 2009, 2011, 2018 Albert Astals Cid <aacid@kde.org>
0017 // Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
0018 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
0019 // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
0020 // Copyright (C) 2018 Oliver Sander <oliver.sander@tu-dresden.de>
0021 //
0022 // To see a description of the changes please see the Changelog file that
0023 // came with your tarball or type make ChangeLog if you are building from git
0024 //
0025 //========================================================================
0026 
0027 #ifndef SPLASHFONTENGINE_H
0028 #define SPLASHFONTENGINE_H
0029 
0030 #include <array>
0031 
0032 #include "SplashTypes.h"
0033 #include "poppler_private_export.h"
0034 
0035 class SplashT1FontEngine;
0036 class SplashFTFontEngine;
0037 class SplashDTFontEngine;
0038 class SplashDT4FontEngine;
0039 class SplashFontFile;
0040 class SplashFontFileID;
0041 class SplashFont;
0042 class SplashFontSrc;
0043 
0044 //------------------------------------------------------------------------
0045 // SplashFontEngine
0046 //------------------------------------------------------------------------
0047 
0048 class POPPLER_PRIVATE_EXPORT SplashFontEngine
0049 {
0050 public:
0051     // Create a font engine.
0052     SplashFontEngine(bool enableFreeType, bool enableFreeTypeHinting, bool enableSlightHinting, bool aa);
0053 
0054     ~SplashFontEngine();
0055 
0056     SplashFontEngine(const SplashFontEngine &) = delete;
0057     SplashFontEngine &operator=(const SplashFontEngine &) = delete;
0058 
0059     // Get a font file from the cache.  Returns NULL if there is no
0060     // matching entry in the cache.
0061     SplashFontFile *getFontFile(SplashFontFileID *id);
0062 
0063     // Load fonts - these create new SplashFontFile objects.
0064     SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
0065     SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
0066     SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
0067     SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
0068     SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen);
0069     SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex = 0);
0070 
0071     // Get a font - this does a cache lookup first, and if not found,
0072     // creates a new SplashFont object and adds it to the cache.  The
0073     // matrix, mat = textMat * ctm:
0074     //    [ mat[0] mat[1] ]
0075     //    [ mat[2] mat[3] ]
0076     // specifies the font transform in PostScript style:
0077     //    [x' y'] = [x y] * mat
0078     // Note that the Splash y axis points downward.
0079     SplashFont *getFont(SplashFontFile *fontFile, const SplashCoord *textMat, const SplashCoord *ctm);
0080     bool getAA();
0081     void setAA(bool aa);
0082 
0083 private:
0084     std::array<SplashFont *, 16> fontCache;
0085 
0086     SplashFTFontEngine *ftEngine;
0087 };
0088 
0089 #endif