1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

begun work on updating pdf2htmlEX to poppler-0.83.0

This commit is contained in:
Stephen Gaito 2019-12-13 09:20:31 +00:00
parent 7b6f22f636
commit 53bba3d3e7
7 changed files with 26 additions and 26 deletions

View File

@ -10,7 +10,7 @@ export MAKE_PARALLEL="-j $(nproc)"
# choose one of the following... # choose one of the following...
# #
export PDF2HTMLEX_BRANCH=fontforge-update export PDF2HTMLEX_BRANCH=update-poppler
# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
################ ################

View File

@ -3,7 +3,7 @@
# This bash script automates the process of getting the original pdf2htmlEX # This bash script automates the process of getting the original pdf2htmlEX
# source # source
PDF2HTMLEX_BRANCH=fontforge-update PDF2HTMLEX_BRANCH=update-poppler
echo "" echo ""
echo "-------------------------------------------------------------------" echo "-------------------------------------------------------------------"

View File

@ -36,8 +36,9 @@
// //
//======================================================================== //========================================================================
#include <poppler-config.h> #include <config.h>
#include "config.h"
#include <string.h> #include <string.h>
#include "CairoFontEngine.h" #include "CairoFontEngine.h"
#include "CairoOutputDev.h" #include "CairoOutputDev.h"
@ -90,7 +91,7 @@ CairoFont::getFontFace(void) {
unsigned long unsigned long
CairoFont::getGlyph(CharCode code, CairoFont::getGlyph(CharCode code,
Unicode *u, int uLen) { const Unicode *u, int uLen) {
FT_UInt gid; FT_UInt gid;
if (codeToGID && code < codeToGIDLen) { if (codeToGID && code < codeToGIDLen) {

View File

@ -15,7 +15,7 @@
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com> // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2005, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005, 2018, 2019 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net> // Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2008, 2017 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2008, 2017 Adrian Johnson <ajohnson@redneon.com>
@ -54,7 +54,7 @@ public:
virtual bool matches(Ref &other, bool printing); virtual bool matches(Ref &other, bool printing);
cairo_font_face_t *getFontFace(void); cairo_font_face_t *getFontFace(void);
unsigned long getGlyph(CharCode code, Unicode *u, int uLen); unsigned long getGlyph(CharCode code, const Unicode *u, int uLen);
double getSubstitutionCorrection(GfxFont *gfxFont); double getSubstitutionCorrection(GfxFont *gfxFont);
bool isSubstitute() { return substitute; } bool isSubstitute() { return substitute; }

View File

@ -38,7 +38,7 @@
// //
//======================================================================== //========================================================================
#include <poppler-config.h> #include <config.h>
#include <cstdint> #include <cstdint>
#include <string.h> #include <string.h>
@ -712,7 +712,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
/* Align stroke coordinate i if the point is the start or end of a /* Align stroke coordinate i if the point is the start or end of a
* horizontal or vertical line */ * horizontal or vertical line */
void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y) void CairoOutputDev::alignStrokeCoords(const GfxSubpath *subpath, int i, double *x, double *y)
{ {
double x1, y1, x2, y2; double x1, y1, x2, y2;
bool align = false; bool align = false;
@ -752,13 +752,12 @@ void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, do
#undef STROKE_COORD_TOLERANCE #undef STROKE_COORD_TOLERANCE
void CairoOutputDev::doPath(cairo_t *c, GfxState *state, GfxPath *path) { void CairoOutputDev::doPath(cairo_t *c, GfxState *state, const GfxPath *path) {
GfxSubpath *subpath;
int i, j; int i, j;
double x, y; double x, y;
cairo_new_path (c); cairo_new_path (c);
for (i = 0; i < path->getNumSubpaths(); ++i) { for (i = 0; i < path->getNumSubpaths(); ++i) {
subpath = path->getSubpath(i); const GfxSubpath *subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0) { if (subpath->getNumPoints() > 0) {
if (align_stroke_coords) { if (align_stroke_coords) {
alignStrokeCoords(subpath, 0, &x, &y); alignStrokeCoords(subpath, 0, &x, &y);
@ -1395,7 +1394,7 @@ void CairoOutputDev::beginString(GfxState *state, const GooString *s)
void CairoOutputDev::drawChar(GfxState *state, double x, double y, void CairoOutputDev::drawChar(GfxState *state, double x, double y,
double dx, double dy, double dx, double dy,
double originX, double originY, double originX, double originY,
CharCode code, int nBytes, Unicode *u, int uLen) CharCode code, int nBytes, const Unicode *u, int uLen)
{ {
if (currentFont) { if (currentFont) {
glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen); glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen);
@ -1512,7 +1511,7 @@ finish:
bool CairoOutputDev::beginType3Char(GfxState *state, double x, double y, bool CairoOutputDev::beginType3Char(GfxState *state, double x, double y,
double dx, double dy, double dx, double dy,
CharCode code, Unicode *u, int uLen) { CharCode code, const Unicode *u, int uLen) {
cairo_save (cairo); cairo_save (cairo);
cairo_matrix_t matrix; cairo_matrix_t matrix;
@ -3068,7 +3067,7 @@ private:
GfxRGB *lookup; GfxRGB *lookup;
int width; int width;
GfxImageColorMap *colorMap; GfxImageColorMap *colorMap;
int *maskColors; const int *maskColors;
int current_row; int current_row;
bool imageError; bool imageError;
@ -3078,7 +3077,7 @@ public:
int scaledWidth, int scaledHeight, int scaledWidth, int scaledHeight,
bool printing, bool printing,
GfxImageColorMap *colorMapA, GfxImageColorMap *colorMapA,
int *maskColorsA) { const int *maskColorsA) {
cairo_surface_t *image = nullptr; cairo_surface_t *image = nullptr;
int i; int i;
@ -3253,7 +3252,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int widthA, int heightA, int widthA, int heightA,
GfxImageColorMap *colorMap, GfxImageColorMap *colorMap,
bool interpolate, bool interpolate,
int *maskColors, bool inlineImg) const int *maskColors, bool inlineImg)
{ {
cairo_surface_t *image; cairo_surface_t *image;
cairo_pattern_t *pattern, *maskPattern; cairo_pattern_t *pattern, *maskPattern;
@ -3474,7 +3473,7 @@ void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref,
void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap, int width, int height, GfxImageColorMap *colorMap,
bool interpolate, int *maskColors, bool inlineImg) bool interpolate, const int *maskColors, bool inlineImg)
{ {
cairo_t *cr; cairo_t *cr;
cairo_surface_t *surface; cairo_surface_t *surface;

View File

@ -192,13 +192,13 @@ public:
void drawChar(GfxState *state, double x, double y, void drawChar(GfxState *state, double x, double y,
double dx, double dy, double dx, double dy,
double originX, double originY, double originX, double originY,
CharCode code, int nBytes, Unicode *u, int uLen) override; CharCode code, int nBytes, const Unicode *u, int uLen) override;
void beginActualText(GfxState *state, const GooString *text) override; void beginActualText(GfxState *state, const GooString *text) override;
void endActualText(GfxState *state) override; void endActualText(GfxState *state) override;
bool beginType3Char(GfxState *state, double x, double y, bool beginType3Char(GfxState *state, double x, double y,
double dx, double dy, double dx, double dy,
CharCode code, Unicode *u, int uLen) override; CharCode code, const Unicode *u, int uLen) override;
void endType3Char(GfxState *state) override; void endType3Char(GfxState *state) override;
void beginTextObject(GfxState *state) override; void beginTextObject(GfxState *state) override;
void endTextObject(GfxState *state) override; void endTextObject(GfxState *state) override;
@ -221,7 +221,7 @@ public:
void drawImage(GfxState *state, Object *ref, Stream *str, void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap, int width, int height, GfxImageColorMap *colorMap,
bool interpolate, int *maskColors, bool inlineImg) override; bool interpolate, const int *maskColors, bool inlineImg) override;
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height, int width, int height,
GfxImageColorMap *colorMap, GfxImageColorMap *colorMap,
@ -274,7 +274,7 @@ public:
double *getType3GlyphBBox () { return t3_glyph_bbox; } double *getType3GlyphBBox () { return t3_glyph_bbox; }
protected: protected:
void doPath(cairo_t *cairo, GfxState *state, GfxPath *path); void doPath(cairo_t *cairo, GfxState *state, const GfxPath *path);
cairo_surface_t *downscaleSurface(cairo_surface_t *orig_surface); cairo_surface_t *downscaleSurface(cairo_surface_t *orig_surface);
void getScaledSize(const cairo_matrix_t *matrix, void getScaledSize(const cairo_matrix_t *matrix,
int orig_width, int orig_height, int orig_width, int orig_height,
@ -285,7 +285,7 @@ protected:
void setMimeData(GfxState *state, Stream *str, Object *ref, void setMimeData(GfxState *state, Stream *str, Object *ref,
GfxImageColorMap *colorMap, cairo_surface_t *image, int height); GfxImageColorMap *colorMap, cairo_surface_t *image, int height);
void fillToStrokePathClip(GfxState *state); void fillToStrokePathClip(GfxState *state);
void alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y); void alignStrokeCoords(const GfxSubpath *subpath, int i, double *x, double *y);
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0) #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
bool setMimeDataForJBIG2Globals (Stream *str, cairo_surface_t *image); bool setMimeDataForJBIG2Globals (Stream *str, cairo_surface_t *image);
#endif #endif
@ -469,7 +469,7 @@ public:
bool interpolate, bool inlineImg) override; bool interpolate, bool inlineImg) override;
void drawImage(GfxState *state, Object *ref, Stream *str, void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap, int width, int height, GfxImageColorMap *colorMap,
bool interpolate, int *maskColors, bool inlineImg) override; bool interpolate, const int *maskColors, bool inlineImg) override;
void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height, int width, int height,
GfxImageColorMap *colorMap, GfxImageColorMap *colorMap,

View File

@ -44,7 +44,7 @@
/* This implements a box filter that supports non-integer box sizes */ /* This implements a box filter that supports non-integer box sizes */
#include <poppler-config.h> #include <config.h>
#include <cstdint> #include <cstdint>
#include <stdint.h> #include <stdint.h>
@ -62,8 +62,8 @@
static void downsample_row_box_filter ( static void downsample_row_box_filter (
int start, int width, int start, int width,
uint32_t *src, uint32_t *src_limit, uint32_t *dest, uint32_t *src, const uint32_t *src_limit, uint32_t *dest,
int coverage[], int pixel_coverage) const int coverage[], int pixel_coverage)
{ {
/* we need an array of the pixel contribution of each destination pixel on the boundaries. /* we need an array of the pixel contribution of each destination pixel on the boundaries.
* we invert the value to get the value on the other size of the box */ * we invert the value to get the value on the other size of the box */