~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipemodel/ipefontpool_p.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-06-08 00:44:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040608004402-72yu51xlh7vt6p9m
Tags: upstream-6.0pre16
ImportĀ upstreamĀ versionĀ 6.0pre16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
// --------------------------------------------------------------------
 
3
// Private fontpool implementation
 
4
// --------------------------------------------------------------------
 
5
/*
 
6
 
 
7
    This file is part of the extensible drawing editor Ipe.
 
8
    Copyright (C) 1993-2004  Otfried Cheong
 
9
 
 
10
    Ipe is free software; you can redistribute it and/or modify it
 
11
    under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation; either version 2 of the License, or
 
13
    (at your option) any later version.
 
14
 
 
15
    As a special exception, you have permission to link Ipe with the
 
16
    CGAL library and distribute executables, as long as you follow the
 
17
    requirements of the Gnu General Public License in regard to all of
 
18
    the software in the executable aside from CGAL.
 
19
 
 
20
    Ipe is distributed in the hope that it will be useful, but WITHOUT
 
21
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
22
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 
23
    License for more details.
 
24
 
 
25
    You should have received a copy of the GNU General Public License
 
26
    along with Ipe; if not, you can find it at
 
27
    "http://www.gnu.org/copyleft/gpl.html", or write to the Free
 
28
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
29
 
 
30
*/
 
31
 
 
32
#ifndef FONTPOOL_P_H
 
33
#define FONTPOOL_P_H
 
34
 
 
35
// --------------------------------------------------------------------
 
36
 
 
37
class FTFontEngine;
 
38
class FTFont;
 
39
class FTFace;
 
40
class XRef;
 
41
class Ref;
 
42
class GfxFont;
 
43
 
 
44
class IpeFontPoolPriv {
 
45
public:
 
46
  IpeFontPoolPriv();
 
47
  ~IpeFontPoolPriv();
 
48
 
 
49
  FTFace *GetFace(XRef *xref, GfxFont *gfxFont);
 
50
  FTFont *GetFont(Ref *id, double m11, double m12,
 
51
                  double m21, double m22) const;
 
52
 
 
53
  void RenderCharacter(QPixmap *pixmap, int fontObject,
 
54
                       const IpeMatrix &m,
 
55
                       const IpeVector &pos,
 
56
                       QRgb cRgb, uint charCode, uint uniCode) const;
 
57
 
 
58
private:
 
59
  FTFace *TryGetFTFace(XRef *xref, GfxFont *gfxFont);
 
60
  FTFace *TryGetFTFaceFromBuffer(XRef *xref,
 
61
                                 const char *buffer, int size,
 
62
                                 GfxFont *gfxFont);
 
63
  FTFace *TrySettingFTFaceMode(FTFace *face, GfxFont *gfxFont);
 
64
 
 
65
private:
 
66
  struct EmbeddableFont {
 
67
    int iLatexNumber;    //!< Font id in the Pdflatex output: /Fxx
 
68
    int iObjectNumber;   //!< Object number in Ipe-created PDF output.
 
69
    IpeString iFontDict;
 
70
    IpeString iFontDescriptor;
 
71
    IpeString iStreamDict;
 
72
    IpeBuffer iStreamData;
 
73
  };
 
74
 
 
75
  typedef std::list<FTFace *> FTFaceSeq;
 
76
  typedef std::list<FTFont *> FTFontSeq;
 
77
  typedef std::vector<EmbeddableFont> FontSeq;
 
78
 
 
79
  FTFontEngine *iEngine;
 
80
  FTFaceSeq iFTFaces;
 
81
 
 
82
  mutable FTFontSeq iFTFonts;
 
83
  FontSeq iFonts;
 
84
 
 
85
  friend class IpeLatex;
 
86
  friend class IpePdfWriter;
 
87
};
 
88
 
 
89
// --------------------------------------------------------------------
 
90
#endif