Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //========================================================================
0002 //
0003 // SplashFTFont.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) 2007-2009, 2011, 2018 Albert Astals Cid <aacid@kde.org>
0015 // Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
0016 // Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
0017 // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
0018 // Copyright (C) 2018 Oliver Sander <oliver.sander@tu-dresden.de>
0019 //
0020 // To see a description of the changes please see the Changelog file that
0021 // came with your tarball or type make ChangeLog if you are building from git
0022 //
0023 //========================================================================
0024 
0025 #ifndef SPLASHFTFONT_H
0026 #define SPLASHFTFONT_H
0027 
0028 #include "poppler-config.h"
0029 
0030 #include <ft2build.h>
0031 #include FT_FREETYPE_H
0032 #include "SplashFont.h"
0033 
0034 class SplashFTFontFile;
0035 
0036 //------------------------------------------------------------------------
0037 // SplashFTFont
0038 //------------------------------------------------------------------------
0039 
0040 class SplashFTFont : public SplashFont
0041 {
0042 public:
0043     SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA, const SplashCoord *textMatA);
0044 
0045     ~SplashFTFont() override;
0046 
0047     // Munge xFrac and yFrac before calling SplashFont::getGlyph.
0048     bool getGlyph(int c, int xFrac, int yFrac, SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) override;
0049 
0050     // Rasterize a glyph.  The <xFrac> and <yFrac> values are the same
0051     // as described for getGlyph.
0052     bool makeGlyph(int c, int xFrac, int yFrac, SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) override;
0053 
0054     // Return the path for a glyph.
0055     SplashPath *getGlyphPath(int c) override;
0056 
0057     // Return the advance of a glyph. (in 0..1 range)
0058     double getGlyphAdvance(int c) override;
0059 
0060 private:
0061     FT_Size sizeObj;
0062     FT_Matrix matrix;
0063     FT_Matrix textMatrix;
0064     SplashCoord textScale;
0065     int size;
0066     bool enableFreeTypeHinting;
0067     bool enableSlightHinting;
0068     bool isOk;
0069 };
0070 
0071 #endif