FoFiType1.h 1.88 KB
Newer Older
Kristian Høgsberg's avatar
Kristian Høgsberg committed
1 2 3 4 5 6 7 8
//========================================================================
//
// FoFiType1.h
//
// Copyright 1999-2003 Glyph & Cog, LLC
//
//========================================================================

9 10 11 12 13 14 15 16 17 18 19 20 21 22
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
//
// 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
23 24 25 26 27 28 29 30 31 32 33 34 35
#ifndef FOFITYPE1_H
#define FOFITYPE1_H

#include "FoFiBase.h"

//------------------------------------------------------------------------
// FoFiType1
//------------------------------------------------------------------------

class FoFiType1: public FoFiBase {
public:

  // Create a FoFiType1 object from a memory buffer.
36
  static FoFiType1 *make(const char *fileA, int lenA);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
37 38

  // Create a FoFiType1 object from a file on disk.
39
  static FoFiType1 *load(const char *fileName);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
40

41
  ~FoFiType1() override;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
42 43

  // Return the font name.
44
  const char *getName();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
45 46 47 48 49

  // Return the encoding, as an array of 256 names (any of which may
  // be NULL).
  char **getEncoding();

50 51 52
  // Return the font matrix as an array of six numbers.
  void getFontMatrix(double *mat);

Kristian Høgsberg's avatar
Kristian Høgsberg committed
53
  // Write a version of the Type 1 font file with a new encoding.
54
  void writeEncoded(const char **newEncoding,
55
		    FoFiOutputFunc outputFunc, void *outputStream) const;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
56 57 58

private:

59
  FoFiType1(const char *fileA, int lenA, bool freeFileDataA);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
60

61
  char *getNextLine(char *line) const;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
62
  void parse();
63
  void undoPFB();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
64 65 66

  char *name;
  char **encoding;
67
  double fontMatrix[6];
68
  bool parsed;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
69 70 71
};

#endif