diff options
author | Jason Crain <jason@aquaticape.us> | 2012-09-11 19:28:28 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2012-09-11 19:28:28 +0200 |
commit | f3a1b765bd6a58d327a80feedbe30e1c0792076e (patch) | |
tree | e72cbfe321339f8b947273d12731c915ff5183a5 /poppler/TextOutputDev.h | |
parent | e79b70ec13ab4d2cce8f245d150fa9329b436658 (diff) |
Allow multiple fonts in a TextWord
Bug #6923
Diffstat (limited to 'poppler/TextOutputDev.h')
-rw-r--r-- | poppler/TextOutputDev.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h index e31876b9..100f23e0 100644 --- a/poppler/TextOutputDev.h +++ b/poppler/TextOutputDev.h @@ -19,6 +19,7 @@ // Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2008, 2010 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2010 Brian Ewins <brian.ewins@gmail.com> +// Copyright (C) 2012 Jason Crain <jason@aquaticape.us> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -113,14 +114,13 @@ class TextWord { public: // Constructor. - TextWord(GfxState *state, int rotA, double x0, double y0, - TextFontInfo *fontA, double fontSize); + TextWord(GfxState *state, int rotA, double fontSize); // Destructor. ~TextWord(); // Add a character to the word. - void addChar(GfxState *state, double x, double y, + void addChar(GfxState *state, TextFontInfo *fontA, double x, double y, double dx, double dy, int charPosA, int charLen, CharCode c, Unicode u); @@ -141,8 +141,8 @@ public: PDFRectangle *selection, SelectionStyle style); - // Get the TextFontInfo object associated with this word. - TextFontInfo *getFontInfo() { return font; } + // Get the TextFontInfo object associated with a character. + TextFontInfo *getFontInfo(int idx) { return font[idx]; } // Get the next TextWord on the linked list. TextWord *getNext() { return next; } @@ -151,7 +151,7 @@ public: int getLength() { return len; } const Unicode *getChar(int idx) { return &text[idx]; } GooString *getText(); - GooString *getFontName() { return font->fontName; } + GooString *getFontName(int idx) { return font[idx]->fontName; } void getColor(double *r, double *g, double *b) { *r = colorR; *g = colorG; *b = colorB; } void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA) @@ -184,13 +184,14 @@ private: int *charPos; // character position (within content stream) // of each char (plus one extra entry for // the last char) - int len; // length of text/edge/charPos arrays - int size; // size of text/edge/charPos arrays - TextFontInfo *font; // font information + int len; // length of text/edge/charPos/font arrays + int size; // size of text/edge/charPos/font arrays + TextFontInfo **font; // font information for each char double fontSize; // font size GBool spaceAfter; // set if there is a space between this // word and the next word on the line TextWord *next; // next word in line + int wMode; // horizontal (0) or vertical (1) writing mode #if TEXTOUT_WORD_LIST double colorR, // word color @@ -498,7 +499,7 @@ public: void updateFont(GfxState *state); // Begin a new word. - void beginWord(GfxState *state, double x0, double y0); + void beginWord(GfxState *state); // Add a character to the current word. void addChar(GfxState *state, double x, double y, |