summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-06-22 19:57:26 +0200
committerTor Andersson <tor@ghostscript.com>2010-06-22 19:57:26 +0200
commit0edb7f95c50f0012ae173b3fa42cebe2905f1826 (patch)
tree94480fda293955fe7a6aa253e5dadd178a0798f8 /fitz
parent7c2008556ad928cfa2845f1532c63dfdedbd768b (diff)
downloadmupdf-0edb7f95c50f0012ae173b3fa42cebe2905f1826.tar.xz
Add hints flag to device struct so that the interpreter doesn't need to load image resources for dev_text.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/dev_null.c2
-rw-r--r--fitz/dev_text.c5
-rw-r--r--fitz/fitz_draw.h8
3 files changed, 12 insertions, 3 deletions
diff --git a/fitz/dev_null.c b/fitz/dev_null.c
index 9e4ee764..1c3788a5 100644
--- a/fitz/dev_null.c
+++ b/fitz/dev_null.c
@@ -22,6 +22,8 @@ fz_newdevice(void *user)
fz_device *dev = fz_malloc(sizeof(fz_device));
memset(dev, 0, sizeof(fz_device));
+ dev->hints = 0;
+
dev->user = user;
dev->freeuser = fz_nullfreeuser;
diff --git a/fitz/dev_text.c b/fitz/dev_text.c
index d08b2f64..29319714 100644
--- a/fitz/dev_text.c
+++ b/fitz/dev_text.c
@@ -340,9 +340,7 @@ fz_textextractspan(fz_textspan **last, fz_text *text, fz_matrix ctm, fz_point *p
int mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;
if (text->wmode)
mask |= FT_LOAD_VERTICAL_LAYOUT;
- err = FT_Get_Advance(font->ftface, text->els[i].gid, mask, &ftadv);
- if (err)
- fz_warn("freetype get advance (gid %d): %s", text->els[i].gid, ft_errorstring(err));
+ FT_Get_Advance(font->ftface, text->els[i].gid, mask, &ftadv);
adv = ftadv / 65536.0f;
if (text->wmode)
{
@@ -438,6 +436,7 @@ fz_newtextdevice(fz_textspan *root)
tdev->point.y = -1;
dev = fz_newdevice(tdev);
+ dev->hints = FZ_IGNOREIMAGE | FZ_IGNORESHADE;
dev->freeuser = fz_textfreeuser;
dev->filltext = fz_textfilltext;
dev->stroketext = fz_textstroketext;
diff --git a/fitz/fitz_draw.h b/fitz/fitz_draw.h
index e622d81a..077edd0b 100644
--- a/fitz/fitz_draw.h
+++ b/fitz/fitz_draw.h
@@ -71,10 +71,18 @@ fz_pixmap * fz_scalepixmap(fz_pixmap *src, int xdenom, int ydenom);
* The device interface.
*/
+enum
+{
+ FZ_IGNOREIMAGE = 1,
+ FZ_IGNORESHADE = 2,
+};
+
typedef struct fz_device_s fz_device;
struct fz_device_s
{
+ int hints;
+
void *user;
void (*freeuser)(void *);