summaryrefslogtreecommitdiff
path: root/fitz/dev_text.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-02-08 18:57:12 +0000
committerTor Andersson <tor@ghostscript.com>2011-02-08 18:57:12 +0000
commit6205aa0eca87e3fce1e206883742f2945fd27022 (patch)
treecdad3bec9a002742a7e4708c10f99cba74c49682 /fitz/dev_text.c
parentaafdc1ed884033a2eea2f81385102ad8ebbb1a4d (diff)
downloadmupdf-6205aa0eca87e3fce1e206883742f2945fd27022.tar.xz
Use horizontal metrics to create text boxes instead of guessing at bad vertical values.
Diffstat (limited to 'fitz/dev_text.c')
-rw-r--r--fitz/dev_text.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/fitz/dev_text.c b/fitz/dev_text.c
index 8f22cfd1..d24cb555 100644
--- a/fitz/dev_text.c
+++ b/fitz/dev_text.c
@@ -338,25 +338,17 @@ fz_textextractspan(fz_textspan **last, fz_text *text, fz_matrix ctm, fz_point *p
{
FT_Fixed ftadv = 0;
int mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING | FT_LOAD_IGNORE_TRANSFORM;
- if (text->wmode)
- mask |= FT_LOAD_VERTICAL_LAYOUT;
+
+ /* TODO: freetype returns broken vertical metrics */
+ /* if (text->wmode) mask |= FT_LOAD_VERTICAL_LAYOUT; */
+
FT_Get_Advance(font->ftface, text->els[i].gid, mask, &ftadv);
adv = ftadv / 65536.0f;
- if (text->wmode)
- {
- adv = -1; /* TODO: freetype returns broken vertical metrics */
- rect.x0 = 0;
- rect.y0 = 0;
- rect.x1 = 1;
- rect.y1 = adv;
- }
- else
- {
- rect.x0 = 0;
- rect.y0 = descender;
- rect.x1 = adv;
- rect.y1 = ascender;
- }
+
+ rect.x0 = 0;
+ rect.y0 = descender;
+ rect.x1 = adv;
+ rect.y1 = ascender;
}
else
{