~ubuntu-branches/ubuntu/dapper/poppler/dapper-security

« back to all changes in this revision

Viewing changes to splash/SplashFTFontEngine.cc

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-03-06 18:42:44 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060306184244-oomqyiqr7cgncp2c
Tags: 0.5.1-0ubuntu1
* New upstream version:
  - Support for embedded files.
  - Handle 0-width lines correctly.
  - Avoid external file use when opening fonts.
  - Only use vector fonts returned from fontconfig (#5758).
  - Fix scaled 1x1 pixmaps use for drawing lines (#3387).
  - drawSoftMaskedImage support in cairo backend.
  - Misc bug fixes: #5922, #5946, #5749, #5952, #4030, #5420.
* debian/control.in, debian/libpoppler0c2.dirs, 
  debian/libpoppler0c2-glib.dirs, debian/libpoppler0c2-glib.install,
  debian/libpoppler0c2.install, debian/libpoppler0c2-qt.dirs,
  debian/libpoppler0c2-qt.install, debian/rules:
  - updated for the soname change
* debian/patches/000_splash_build_fix.patch:
  - fix build when using splash
* debian/patches/001_fixes_for_fonts_selection.patch:
  - fix with the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
}
65
65
 
66
66
SplashFontFile *SplashFTFontEngine::loadType1Font(SplashFontFileID *idA,
67
 
                                                  char *fileName,
68
 
                                                  GBool deleteFile,
 
67
                                                  SplashFontSrc *src,
69
68
                                                  char **enc) {
70
 
  return SplashFTFontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
 
69
  return SplashFTFontFile::loadType1Font(this, idA, src, enc);
71
70
}
72
71
 
73
72
SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA,
74
 
                                                   char *fileName,
75
 
                                                   GBool deleteFile,
 
73
                                                   SplashFontSrc *src,
76
74
                                                   char **enc) {
77
 
  return SplashFTFontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
 
75
  return SplashFTFontFile::loadType1Font(this, idA, src, enc);
78
76
}
79
77
 
80
78
SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA,
81
 
                                                char *fileName,
82
 
                                                GBool deleteFile) {
 
79
                                                SplashFontSrc *src) {
83
80
  FoFiType1C *ff;
84
81
  Gushort *cidToGIDMap;
85
82
  int nCIDs;
89
86
  if (useCIDs) {
90
87
    cidToGIDMap = NULL;
91
88
    nCIDs = 0;
92
 
  } else if ((ff = FoFiType1C::load(fileName))) {
 
89
  } else {
 
90
    if (src->isFile) {
 
91
      ff = FoFiType1C::load(src->fileName->getCString());
 
92
    } else {
 
93
      ff = new FoFiType1C(src->buf, src->bufLen, gFalse);
 
94
    }
 
95
    if (ff) {
93
96
    cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
94
97
    delete ff;
95
98
  } else {
96
99
    cidToGIDMap = NULL;
97
100
    nCIDs = 0;
98
101
  }
99
 
  ret = SplashFTFontFile::loadCIDFont(this, idA, fileName, deleteFile,
100
 
                                      cidToGIDMap, nCIDs);
 
102
  }
 
103
  ret = SplashFTFontFile::loadCIDFont(this, idA, src, cidToGIDMap, nCIDs);
101
104
  if (!ret) {
102
105
    gfree(cidToGIDMap);
103
106
  }
105
108
}
106
109
 
107
110
SplashFontFile *SplashFTFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
108
 
                                                     char *fileName,
109
 
                                                     GBool deleteFile,
 
111
                                                     SplashFontSrc *src,
110
112
                                                     Gushort *codeToGID,
111
 
                                                     int codeToGIDLen) {
 
113
                                                     int codeToGIDLen,
 
114
                                                     int faceIndex) {
 
115
#if 0
112
116
  FoFiTrueType *ff;
113
117
  GooString *tmpFileName;
114
118
  FILE *tmpFile;
115
119
  SplashFontFile *ret;
116
120
 
117
 
  if (!(ff = FoFiTrueType::load(fileName))) {
 
121
  if (!(ff = FoFiTrueType::load(fileName, faceIndex))) {
118
122
    return NULL;
119
123
  }
120
124
  tmpFileName = NULL;
127
131
  fclose(tmpFile);
128
132
  ret = SplashFTFontFile::loadTrueTypeFont(this, idA,
129
133
                                           tmpFileName->getCString(),
130
 
                                           gTrue, codeToGID, codeToGIDLen);
 
134
                                           gTrue, codeToGID, codeToGIDLen,
 
135
                                           faceIndex);
131
136
  if (ret) {
132
137
    if (deleteFile) {
133
138
      unlink(fileName);
137
142
  }
138
143
  delete tmpFileName;
139
144
  return ret;
 
145
#else
 
146
  SplashFontFile *ret;
 
147
  ret = SplashFTFontFile::loadTrueTypeFont(this, idA, src,
 
148
                                           codeToGID, codeToGIDLen,
 
149
                                           faceIndex);
 
150
  return ret;
 
151
#endif
140
152
}
141
153
 
142
154
#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H