summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-06-23 11:48:43 +0200
committerTor Andersson <tor@ghostscript.com>2010-06-23 11:48:43 +0200
commitec800ef7d186188dd0dd7132ef5e7c2fda55a499 (patch)
tree9e919a52388fccb89dcaec8b92bba94d565a0b85
parent81644baeebfb2edaebe3839b7763595eb0e94be2 (diff)
downloadmupdf-ec800ef7d186188dd0dd7132ef5e7c2fda55a499.tar.xz
Tweak how often spaces are inserted in dev_ext.
-rw-r--r--fitz/dev_text.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fitz/dev_text.c b/fitz/dev_text.c
index 29319714..fc00272a 100644
--- a/fitz/dev_text.c
+++ b/fitz/dev_text.c
@@ -1,7 +1,7 @@
#include "fitz.h"
#define LINEDIST 0.9f
-#define SPACEDIST 0.25f
+#define SPACEDIST 0.1f
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -14,7 +14,7 @@ int
FT_Get_Advance(FT_Face face, int gid, int masks, FT_Fixed *out)
{
int err;
- err = FT_Load_Glyph(face, gid, masks | FT_LOAD_IGNORE_TRANSFORM);
+ err = FT_Load_Glyph(face, gid, masks);
if (err)
return err;
if (masks & FT_LOAD_VERTICAL_LAYOUT)
@@ -320,7 +320,7 @@ fz_textextractspan(fz_textspan **last, fz_text *text, fz_matrix ctm, fz_point *p
}
else if (fabsf(dot) > 0.95f && dist > size * SPACEDIST)
{
- if ((*last)->len == 0 || (*last)->text[(*last)->len - 1].c != ' ')
+ if ((*last)->len != 0 || (*last)->text[(*last)->len - 1].c != ' ')
{
fz_rect spacerect;
spacerect.x0 = -0.2f;
@@ -337,11 +337,11 @@ fz_textextractspan(fz_textspan **last, fz_text *text, fz_matrix ctm, fz_point *p
if (font->ftface)
{
FT_Fixed ftadv = 0;
- int mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;
+ int mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING | FT_LOAD_IGNORE_TRANSFORM;
if (text->wmode)
mask |= FT_LOAD_VERTICAL_LAYOUT;
FT_Get_Advance(font->ftface, text->els[i].gid, mask, &ftadv);
- adv = ftadv / 65536.0f;
+ adv = ftadv / 1024000.0f;
if (text->wmode)
{
adv = -1; /* TODO: freetype returns broken vertical metrics */