TextOutputDev.h (xpdf-4.03) | : | TextOutputDev.h (xpdf-4.04) | ||
---|---|---|---|---|
skipping to change at line 102 | skipping to change at line 102 | |||
marginBottom; | marginBottom; | |||
}; | }; | |||
//------------------------------------------------------------------------ | //------------------------------------------------------------------------ | |||
// TextFontInfo | // TextFontInfo | |||
//------------------------------------------------------------------------ | //------------------------------------------------------------------------ | |||
class TextFontInfo { | class TextFontInfo { | |||
public: | public: | |||
// Create a TextFontInfo for the current font in [state]. | ||||
TextFontInfo(GfxState *state); | TextFontInfo(GfxState *state); | |||
// Create a dummy TextFontInfo. | ||||
TextFontInfo(); | ||||
~TextFontInfo(); | ~TextFontInfo(); | |||
GBool matches(GfxState *state); | GBool matches(GfxState *state); | |||
// Get the font name (which may be NULL). | // Get the font name (which may be NULL). | |||
GString *getFontName() { return fontName; } | GString *getFontName() { return fontName; } | |||
// Get font descriptor flags. | // Get font descriptor flags. | |||
GBool isFixedWidth() { return flags & fontFixedWidth; } | GBool isFixedWidth() { return flags & fontFixedWidth; } | |||
GBool isSerif() { return flags & fontSerif; } | GBool isSerif() { return flags & fontSerif; } | |||
skipping to change at line 228 | skipping to change at line 233 | |||
double xMaxA, double yMaxA, double fontSizeA); | double xMaxA, double yMaxA, double fontSizeA); | |||
~TextLine(); | ~TextLine(); | |||
double getXMin() { return xMin; } | double getXMin() { return xMin; } | |||
double getYMin() { return yMin; } | double getYMin() { return yMin; } | |||
double getXMax() { return xMax; } | double getXMax() { return xMax; } | |||
double getYMax() { return yMax; } | double getYMax() { return yMax; } | |||
double getBaseline(); | double getBaseline(); | |||
int getRotation() { return rot; } | int getRotation() { return rot; } | |||
GList *getWords() { return words; } | GList *getWords() { return words; } | |||
Unicode *getUnicode() { return text; } | ||||
int getLength() { return len; } | int getLength() { return len; } | |||
double getEdge(int idx) { return edge[idx]; } | double getEdge(int idx) { return edge[idx]; } | |||
GBool getHyphenated() { return hyphenated; } | GBool getHyphenated() { return hyphenated; } | |||
private: | private: | |||
static int cmpX(const void *p1, const void *p2); | static int cmpX(const void *p1, const void *p2); | |||
GList *words; // [TextWord] | GList *words; // [TextWord] | |||
int rot; // rotation, multiple of 90 degrees | int rot; // rotation, multiple of 90 degrees | |||
skipping to change at line 479 | skipping to change at line 485 | |||
double xMax, double yMax); | double xMax, double yMax); | |||
// Returns true if the primary character direction is left-to-right, | // Returns true if the primary character direction is left-to-right, | |||
// false if it is right-to-left. | // false if it is right-to-left. | |||
GBool primaryDirectionIsLR(); | GBool primaryDirectionIsLR(); | |||
// Returns true if any of the fonts used on this page are likely to | // Returns true if any of the fonts used on this page are likely to | |||
// be problematic when converting text to Unicode. | // be problematic when converting text to Unicode. | |||
GBool problematicForUnicode() { return problematic; } | GBool problematicForUnicode() { return problematic; } | |||
// Add a 'special' character to this TextPage. This is currently | ||||
// used by pdftohtml to insert markers for form fields. | ||||
void addSpecialChar(double xMin, double yMin, double xMax, double yMax, | ||||
int rot, TextFontInfo *font, double fontSize, | ||||
Unicode u); | ||||
// Remove characters that fall inside a region. | ||||
void removeChars(double xMin, double yMin, double xMax, double yMax, | ||||
double xOverlapThresh, double yOverlapThresh); | ||||
private: | private: | |||
void startPage(GfxState *state); | void startPage(GfxState *state); | |||
void clear(); | void clear(); | |||
void updateFont(GfxState *state); | void updateFont(GfxState *state); | |||
void addChar(GfxState *state, double x, double y, | void addChar(GfxState *state, double x, double y, | |||
double dx, double dy, | double dx, double dy, | |||
CharCode c, int nBytes, Unicode *u, int uLen); | CharCode c, int nBytes, Unicode *u, int uLen); | |||
void incCharCount(int nChars); | void incCharCount(int nChars); | |||
void beginActualText(GfxState *state, Unicode *u, int uLen); | void beginActualText(GfxState *state, Unicode *u, int uLen); | |||
skipping to change at line 527 | skipping to change at line 543 | |||
UnicodeMap *uMap, | UnicodeMap *uMap, | |||
char *space, int spaceLen, | char *space, int spaceLen, | |||
char *eol, int eolLen); | char *eol, int eolLen); | |||
void writeRaw(void *outputStream, | void writeRaw(void *outputStream, | |||
TextOutputFunc outputFunc, | TextOutputFunc outputFunc, | |||
UnicodeMap *uMap, | UnicodeMap *uMap, | |||
char *space, int spaceLen, | char *space, int spaceLen, | |||
char *eol, int eolLen); | char *eol, int eolLen); | |||
void encodeFragment(Unicode *text, int len, UnicodeMap *uMap, | void encodeFragment(Unicode *text, int len, UnicodeMap *uMap, | |||
GBool primaryLR, GString *s); | GBool primaryLR, GString *s); | |||
GBool unicodeEffectiveTypeLOrNum(Unicode u, Unicode left, Unicode right); | ||||
GBool unicodeEffectiveTypeR(Unicode u, Unicode left, Unicode right); | ||||
// analysis | // analysis | |||
int rotateChars(GList *charsA); | int rotateChars(GList *charsA); | |||
void rotateCharsToZero(GList *charsA); | void rotateCharsToZero(GList *charsA); | |||
void rotateUnderlinesAndLinks(int rot); | void rotateUnderlinesAndLinks(int rot); | |||
void unrotateChars(GList *charsA, int rot); | void unrotateChars(GList *charsA, int rot); | |||
void unrotateCharsFromZero(GList *charsA); | void unrotateCharsFromZero(GList *charsA); | |||
void unrotateColumnsFromZero(GList *columns); | void unrotateColumnsFromZero(GList *columns); | |||
void unrotateColumns(GList *columns, int rot); | void unrotateColumns(GList *columns, int rot); | |||
void unrotateWords(GList *words, int rot); | void unrotateWords(GList *words, int rot); | |||
GBool checkPrimaryLR(GList *charsA); | GBool checkPrimaryLR(GList *charsA); | |||
void removeDuplicates(GList *charsA, int rot); | void removeDuplicates(GList *charsA, int rot); | |||
GList *separateOverlappingText(GList *charsA); | GList *separateOverlappingText(GList *charsA); | |||
TextColumn *buildOverlappingTextColumn(GList *overlappingChars); | TextColumn *buildOverlappingTextColumn(GList *overlappingChars); | |||
TextBlock *splitChars(GList *charsA); | TextBlock *splitChars(GList *charsA); | |||
TextBlock *split(GList *charsA, int rot); | TextBlock *split(GList *charsA, int rot, GBool vertOnly); | |||
GList *getChars(GList *charsA, double xMin, double yMin, | GList *getChars(GList *charsA, double xMin, double yMin, | |||
double xMax, double yMax); | double xMax, double yMax); | |||
void findGaps(GList *charsA, int rot, | void findGaps(GList *charsA, int rot, | |||
double *xMinOut, double *yMinOut, | double *xMinOut, double *yMinOut, | |||
double *xMaxOut, double *yMaxOut, | double *xMaxOut, double *yMaxOut, | |||
double *avgFontSizeOut, | double *avgFontSizeOut, double *minFontSizeOut, | |||
GList *splitLines, | ||||
TextGaps *horizGaps, TextGaps *vertGaps); | TextGaps *horizGaps, TextGaps *vertGaps); | |||
void mergeSplitLines(GList *charsA, int rot, GList *splitLines); | ||||
void tagBlock(TextBlock *blk); | void tagBlock(TextBlock *blk); | |||
void insertLargeChars(GList *largeChars, TextBlock *blk); | void insertLargeChars(GList *largeChars, TextBlock *blk); | |||
void insertLargeCharsInFirstLeaf(GList *largeChars, TextBlock *blk); | void insertLargeCharsInFirstLeaf(GList *largeChars, TextBlock *blk); | |||
void insertLargeCharInLeaf(TextChar *ch, TextBlock *blk); | void insertLargeCharInLeaf(TextChar *ch, TextBlock *blk); | |||
void insertIntoTree(TextBlock *subtree, TextBlock *primaryTree); | void insertIntoTree(TextBlock *subtree, TextBlock *primaryTree); | |||
void insertColumnIntoTree(TextBlock *column, TextBlock *tree); | void insertColumnIntoTree(TextBlock *column, TextBlock *tree); | |||
void insertClippedChars(GList *clippedChars, TextBlock *tree); | void insertClippedChars(GList *clippedChars, TextBlock *tree); | |||
TextBlock *findClippedCharLeaf(TextChar *ch, TextBlock *tree); | TextBlock *findClippedCharLeaf(TextChar *ch, TextBlock *tree); | |||
GList *buildColumns(TextBlock *tree, GBool primaryLR); | GList *buildColumns(TextBlock *tree, GBool primaryLR); | |||
void buildColumns2(TextBlock *blk, GList *columns, GBool primaryLR); | void buildColumns2(TextBlock *blk, GList *columns, GBool primaryLR); | |||
skipping to change at line 573 | skipping to change at line 593 | |||
double getLineSpacing(TextLine *line0, TextLine *line1); | double getLineSpacing(TextLine *line0, TextLine *line1); | |||
void buildLines(TextBlock *blk, GList *lines, GBool splitSuperLines); | void buildLines(TextBlock *blk, GList *lines, GBool splitSuperLines); | |||
GList *buildSimple2Columns(GList *charsA); | GList *buildSimple2Columns(GList *charsA); | |||
GList *buildSimple2Lines(GList *charsA, int rot); | GList *buildSimple2Lines(GList *charsA, int rot); | |||
TextLine *buildLine(TextBlock *blk); | TextLine *buildLine(TextBlock *blk); | |||
TextLine *buildLine(GList *charsA, int rot, | TextLine *buildLine(GList *charsA, int rot, | |||
double xMin, double yMin, double xMax, double yMax); | double xMin, double yMin, double xMax, double yMax); | |||
void getLineChars(TextBlock *blk, GList *charsA); | void getLineChars(TextBlock *blk, GList *charsA); | |||
double computeWordSpacingThreshold(GList *charsA, int rot); | double computeWordSpacingThreshold(GList *charsA, int rot); | |||
int getCharDirection(TextChar *ch); | int getCharDirection(TextChar *ch); | |||
int getCharDirection(TextChar *ch, TextChar *left, TextChar *right); | ||||
int assignPhysLayoutPositions(GList *columns); | int assignPhysLayoutPositions(GList *columns); | |||
void assignLinePhysPositions(GList *columns); | void assignLinePhysPositions(GList *columns); | |||
void computeLinePhysWidth(TextLine *line, UnicodeMap *uMap); | void computeLinePhysWidth(TextLine *line, UnicodeMap *uMap); | |||
int assignColumnPhysPositions(GList *columns); | int assignColumnPhysPositions(GList *columns); | |||
void buildSuperLines(TextBlock *blk, GList *superLines); | void buildSuperLines(TextBlock *blk, GList *superLines); | |||
void assignSimpleLayoutPositions(GList *superLines, UnicodeMap *uMap); | void assignSimpleLayoutPositions(GList *superLines, UnicodeMap *uMap); | |||
void generateUnderlinesAndLinks(GList *columns); | void generateUnderlinesAndLinks(GList *columns); | |||
void findPointInColumn(TextColumn *col, double x, double y, | void findPointInColumn(TextColumn *col, double x, double y, | |||
TextPosition *pos); | TextPosition *pos); | |||
void buildFindCols(); | void buildFindCols(); | |||
End of changes. 9 change blocks. | ||||
2 lines changed or deleted | 23 lines changed or added |