mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
Rockstar04 master (#5)
* Remove duplicate method * Update Poppler/Cairo * Twwak config file loading
This commit is contained in:
parent
dada10ac04
commit
fc418cff57
20
3rdparty/poppler/git/CairoFontEngine.cc
vendored
20
3rdparty/poppler/git/CairoFontEngine.cc
vendored
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
#include <config.h>
|
#include <poppler-config.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -412,7 +412,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
|
|||||||
|
|
||||||
int *codeToGID;
|
int *codeToGID;
|
||||||
Guint codeToGIDLen;
|
Guint codeToGIDLen;
|
||||||
|
|
||||||
codeToGID = nullptr;
|
codeToGID = nullptr;
|
||||||
codeToGIDLen = 0;
|
codeToGIDLen = 0;
|
||||||
font_data = nullptr;
|
font_data = nullptr;
|
||||||
@ -421,7 +421,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
|
|||||||
fileNameC = nullptr;
|
fileNameC = nullptr;
|
||||||
|
|
||||||
GBool substitute = gFalse;
|
GBool substitute = gFalse;
|
||||||
|
|
||||||
ref = *gfxFont->getID();
|
ref = *gfxFont->getID();
|
||||||
fontType = gfxFont->getType();
|
fontType = gfxFont->getType();
|
||||||
|
|
||||||
@ -457,9 +457,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
|
|||||||
error(errSyntaxError, -1, "could not create type1 face");
|
error(errSyntaxError, -1, "could not create type1 face");
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enc = ((Gfx8BitFont *)gfxFont)->getEncoding();
|
enc = ((Gfx8BitFont *)gfxFont)->getEncoding();
|
||||||
|
|
||||||
codeToGID = (int *)gmallocn(256, sizeof(int));
|
codeToGID = (int *)gmallocn(256, sizeof(int));
|
||||||
codeToGIDLen = 256;
|
codeToGIDLen = 256;
|
||||||
for (i = 0; i < 256; ++i) {
|
for (i = 0; i < 256; ++i) {
|
||||||
@ -526,7 +526,7 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref,
|
|||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case fontCIDType0:
|
case fontCIDType0:
|
||||||
case fontCIDType0C:
|
case fontCIDType0C:
|
||||||
|
|
||||||
@ -811,7 +811,7 @@ CairoFontEngine::CairoFontEngine(FT_Library libA) {
|
|||||||
for (i = 0; i < cairoFontCacheSize; ++i) {
|
for (i = 0; i < cairoFontCacheSize; ++i) {
|
||||||
fontCache[i] = nullptr;
|
fontCache[i] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FT_Int major, minor, patch;
|
FT_Int major, minor, patch;
|
||||||
// as of FT 2.1.8, CID fonts are indexed by CID instead of GID
|
// as of FT 2.1.8, CID fonts are indexed by CID instead of GID
|
||||||
FT_Library_Version(lib, &major, &minor, &patch);
|
FT_Library_Version(lib, &major, &minor, &patch);
|
||||||
@ -824,7 +824,7 @@ CairoFontEngine::CairoFontEngine(FT_Library libA) {
|
|||||||
|
|
||||||
CairoFontEngine::~CairoFontEngine() {
|
CairoFontEngine::~CairoFontEngine() {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cairoFontCacheSize; ++i) {
|
for (i = 0; i < cairoFontCacheSize; ++i) {
|
||||||
if (fontCache[i])
|
if (fontCache[i])
|
||||||
delete fontCache[i];
|
delete fontCache[i];
|
||||||
@ -840,7 +840,7 @@ CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing, XRef *xr
|
|||||||
Ref ref;
|
Ref ref;
|
||||||
CairoFont *font;
|
CairoFont *font;
|
||||||
GfxFontType fontType;
|
GfxFontType fontType;
|
||||||
|
|
||||||
fontEngineLocker();
|
fontEngineLocker();
|
||||||
ref = *gfxFont->getID();
|
ref = *gfxFont->getID();
|
||||||
|
|
||||||
@ -854,7 +854,7 @@ CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing, XRef *xr
|
|||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fontType = gfxFont->getType();
|
fontType = gfxFont->getType();
|
||||||
if (fontType == fontType3)
|
if (fontType == fontType3)
|
||||||
font = CairoType3Font::create (gfxFont, doc, this, printing, xref);
|
font = CairoType3Font::create (gfxFont, doc, this, printing, xref);
|
||||||
|
38
3rdparty/poppler/git/CairoOutputDev.cc
vendored
38
3rdparty/poppler/git/CairoOutputDev.cc
vendored
@ -35,7 +35,7 @@
|
|||||||
//
|
//
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
#include <config.h>
|
#include <poppler-config.h>
|
||||||
|
|
||||||
#ifdef USE_GCC_PRAGMAS
|
#ifdef USE_GCC_PRAGMAS
|
||||||
#pragma implementation
|
#pragma implementation
|
||||||
@ -195,10 +195,10 @@ CairoOutputDev::~CairoOutputDev() {
|
|||||||
cairo_pattern_destroy (mask);
|
cairo_pattern_destroy (mask);
|
||||||
if (shape)
|
if (shape)
|
||||||
cairo_pattern_destroy (shape);
|
cairo_pattern_destroy (shape);
|
||||||
if (text)
|
if (text)
|
||||||
text->decRefCnt();
|
text->decRefCnt();
|
||||||
if (actualText)
|
if (actualText)
|
||||||
delete actualText;
|
delete actualText;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CairoOutputDev::setCairo(cairo_t *cairo)
|
void CairoOutputDev::setCairo(cairo_t *cairo)
|
||||||
@ -225,7 +225,7 @@ void CairoOutputDev::setCairo(cairo_t *cairo)
|
|||||||
|
|
||||||
void CairoOutputDev::setTextPage(TextPage *text)
|
void CairoOutputDev::setTextPage(TextPage *text)
|
||||||
{
|
{
|
||||||
if (this->text)
|
if (this->text)
|
||||||
this->text->decRefCnt();
|
this->text->decRefCnt();
|
||||||
if (actualText)
|
if (actualText)
|
||||||
delete actualText;
|
delete actualText;
|
||||||
@ -669,7 +669,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
|
|||||||
//FIXME: use cairo font engine?
|
//FIXME: use cairo font engine?
|
||||||
if (text)
|
if (text)
|
||||||
text->updateFont(state);
|
text->updateFont(state);
|
||||||
|
|
||||||
currentFont = fontEngine->getFont (state->getFont(), doc, printing, xref);
|
currentFont = fontEngine->getFont (state->getFont(), doc, printing, xref);
|
||||||
|
|
||||||
if (!currentFont)
|
if (!currentFont)
|
||||||
@ -680,7 +680,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
|
|||||||
|
|
||||||
use_show_text_glyphs = state->getFont()->hasToUnicodeCMap() &&
|
use_show_text_glyphs = state->getFont()->hasToUnicodeCMap() &&
|
||||||
cairo_surface_has_show_text_glyphs (cairo_get_target (cairo));
|
cairo_surface_has_show_text_glyphs (cairo_get_target (cairo));
|
||||||
|
|
||||||
double fontSize = state->getFontSize();
|
double fontSize = state->getFontSize();
|
||||||
double *m = state->getTextMat();
|
double *m = state->getTextMat();
|
||||||
/* NOTE: adjusting by a constant is hack. The correct solution
|
/* NOTE: adjusting by a constant is hack. The correct solution
|
||||||
@ -1493,11 +1493,11 @@ void CairoOutputDev::endString(GfxState *state)
|
|||||||
}
|
}
|
||||||
cairo_path_destroy (textClipPath);
|
cairo_path_destroy (textClipPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// append the glyph path
|
// append the glyph path
|
||||||
cairo_glyph_path (cairo, glyphs, glyphCount);
|
cairo_glyph_path (cairo, glyphs, glyphCount);
|
||||||
|
|
||||||
// move the path back into textClipPath
|
// move the path back into textClipPath
|
||||||
// and clear the current path
|
// and clear the current path
|
||||||
textClipPath = cairo_copy_path (cairo);
|
textClipPath = cairo_copy_path (cairo);
|
||||||
cairo_new_path (cairo);
|
cairo_new_path (cairo);
|
||||||
@ -2033,7 +2033,7 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
|
|||||||
|
|
||||||
cairo_matrix_t matrix;
|
cairo_matrix_t matrix;
|
||||||
cairo_get_matrix (cairo, &matrix);
|
cairo_get_matrix (cairo, &matrix);
|
||||||
//XXX: it is possible that we should only do sub pixel positioning if
|
//XXX: it is possible that we should only do sub pixel positioning if
|
||||||
// we are rendering fonts */
|
// we are rendering fonts */
|
||||||
if (!printing && prescaleImages
|
if (!printing && prescaleImages
|
||||||
/* not rotated */
|
/* not rotated */
|
||||||
@ -2086,7 +2086,7 @@ void CairoOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stre
|
|||||||
|
|
||||||
cairo_matrix_t matrix;
|
cairo_matrix_t matrix;
|
||||||
cairo_get_matrix (cairo, &matrix);
|
cairo_get_matrix (cairo, &matrix);
|
||||||
//XXX: it is possible that we should only do sub pixel positioning if
|
//XXX: it is possible that we should only do sub pixel positioning if
|
||||||
// we are rendering fonts */
|
// we are rendering fonts */
|
||||||
if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) {
|
if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) {
|
||||||
drawImageMaskPrescaled(state, ref, str, width, height, invert, gFalse, inlineImg);
|
drawImageMaskPrescaled(state, ref, str, width, height, invert, gFalse, inlineImg);
|
||||||
@ -2588,7 +2588,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
|
|||||||
* so check its underlying color space as well */
|
* so check its underlying color space as well */
|
||||||
int is_identity_transform;
|
int is_identity_transform;
|
||||||
is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
|
is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
|
||||||
(colorMap->getColorSpace()->getMode() == csICCBased &&
|
(colorMap->getColorSpace()->getMode() == csICCBased &&
|
||||||
((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB);
|
((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3372,7 +3372,7 @@ CairoImageOutputDev::~CairoImageOutputDev()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CairoImageOutputDev::saveImage(CairoImage *image)
|
void CairoImageOutputDev::saveImage(CairoImage *image)
|
||||||
{
|
{
|
||||||
if (numImages >= size) {
|
if (numImages >= size) {
|
||||||
size += 16;
|
size += 16;
|
||||||
images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *));
|
images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *));
|
||||||
@ -3491,10 +3491,10 @@ void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
|
|||||||
setCairo (cr);
|
setCairo (cr);
|
||||||
cairo_translate (cr, 0, height);
|
cairo_translate (cr, 0, height);
|
||||||
cairo_scale (cr, width, -height);
|
cairo_scale (cr, width, -height);
|
||||||
|
|
||||||
CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate, maskColors, inlineImg);
|
CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate, maskColors, inlineImg);
|
||||||
image->setImage (surface);
|
image->setImage (surface);
|
||||||
|
|
||||||
setCairo (nullptr);
|
setCairo (nullptr);
|
||||||
cairo_surface_destroy (surface);
|
cairo_surface_destroy (surface);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
@ -3526,11 +3526,11 @@ void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stre
|
|||||||
setCairo (cr);
|
setCairo (cr);
|
||||||
cairo_translate (cr, 0, height);
|
cairo_translate (cr, 0, height);
|
||||||
cairo_scale (cr, width, -height);
|
cairo_scale (cr, width, -height);
|
||||||
|
|
||||||
CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate,
|
CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate,
|
||||||
maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
|
maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
|
||||||
image->setImage (surface);
|
image->setImage (surface);
|
||||||
|
|
||||||
setCairo (nullptr);
|
setCairo (nullptr);
|
||||||
cairo_surface_destroy (surface);
|
cairo_surface_destroy (surface);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
@ -3561,11 +3561,11 @@ void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *
|
|||||||
setCairo (cr);
|
setCairo (cr);
|
||||||
cairo_translate (cr, 0, height);
|
cairo_translate (cr, 0, height);
|
||||||
cairo_scale (cr, width, -height);
|
cairo_scale (cr, width, -height);
|
||||||
|
|
||||||
CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap, interpolate,
|
CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap, interpolate,
|
||||||
maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate);
|
maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate);
|
||||||
image->setImage (surface);
|
image->setImage (surface);
|
||||||
|
|
||||||
setCairo (nullptr);
|
setCairo (nullptr);
|
||||||
cairo_surface_destroy (surface);
|
cairo_surface_destroy (surface);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
Loading…
Reference in New Issue
Block a user