"Fossies" - the Fresh Open Source Software Archive

Member "poppler-0.82.0/poppler/FontInfo.h" (25 Oct 2019, 2672 Bytes) of package /linux/misc/poppler-0.82.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "FontInfo.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.81.0_vs_0.82.0.

    1 //========================================================================
    2 //
    3 // FontInfo.h
    4 //
    5 // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
    6 // Copyright (C) 2005-2008, 2010, 2011, 2018 Albert Astals Cid <aacid@kde.org>
    7 // Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
    8 // Copyright (C) 2009 Pino Toscano <pino@kde.org>
    9 // Copyright (C) 2012 Adrian Johnson <ajohnson@redneon.com>
   10 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
   11 // Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de>
   12 // Copyright (C) 2019 Adam Reichold <adam.reichold@t-online.de>
   13 //
   14 // To see a description of the changes please see the Changelog file that
   15 // came with your tarball or type make ChangeLog if you are building from git
   16 //
   17 //========================================================================
   18 
   19 //========================================================================
   20 //
   21 // Based on code from pdffonts.cc
   22 //
   23 // Copyright 2001-2007 Glyph & Cog, LLC
   24 //
   25 //========================================================================
   26 
   27 #ifndef FONT_INFO_H
   28 #define FONT_INFO_H
   29 
   30 #include "Object.h"
   31 
   32 #include <unordered_set>
   33 
   34 class GfxFont;
   35 class PDFDoc;
   36 
   37 class FontInfo {
   38 public:
   39   enum Type {
   40     unknown,
   41     Type1,
   42     Type1C,
   43     Type1COT,
   44     Type3,
   45     TrueType,
   46     TrueTypeOT,
   47     CIDType0,
   48     CIDType0C,
   49     CIDType0COT,
   50     CIDTrueType,
   51     CIDTrueTypeOT
   52   };
   53     
   54   // Constructor.
   55   FontInfo(GfxFont *fontA, XRef *xrefA);
   56   // Copy constructor
   57   FontInfo(FontInfo& f);
   58   // Destructor.
   59   ~FontInfo();
   60 
   61   FontInfo& operator=(const FontInfo &) = delete;
   62 
   63   GooString *getName()      { return name; };
   64   GooString *getSubstituteName() { return substituteName; };
   65   GooString *getFile()      { return file; };
   66   GooString *getEncoding()      { return encoding; };
   67   Type       getType()      { return type; };
   68   bool      getEmbedded()  { return emb; };
   69   bool      getSubset()    { return subset; };
   70   bool      getToUnicode() { return hasToUnicode; };
   71   Ref        getRef()       { return fontRef; };
   72   Ref        getEmbRef()    { return embRef; };
   73 
   74 private:
   75   GooString *name;
   76   GooString *substituteName;
   77   GooString *file;
   78   GooString *encoding;
   79   Type type;
   80   bool emb;
   81   bool subset;
   82   bool hasToUnicode;
   83   Ref fontRef;
   84   Ref embRef;
   85 };
   86 
   87 class FontInfoScanner {
   88 public:
   89 
   90   // Constructor.
   91   FontInfoScanner(PDFDoc *doc, int firstPage = 0);
   92   // Destructor.
   93   ~FontInfoScanner();
   94 
   95   std::vector<FontInfo*> scan(int nPages);
   96 
   97 private:
   98 
   99   PDFDoc *doc;
  100   int currentPage;
  101   std::unordered_set<int> fonts;
  102   std::unordered_set<int> visitedObjects;
  103 
  104   void scanFonts(XRef *xrefA, Dict *resDict, std::vector<FontInfo*> *fontsList);
  105 };
  106 
  107 #endif