summaryrefslogtreecommitdiff
path: root/fitz/res_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/res_text.c')
-rw-r--r--fitz/res_text.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fitz/res_text.c b/fitz/res_text.c
index 60b7b43f..369e7e2a 100644
--- a/fitz/res_text.c
+++ b/fitz/res_text.c
@@ -111,6 +111,11 @@ fz_addtext(fz_text *text, int gid, int ucs, float x, float y)
text->len++;
}
+static int isxmlmeta(int c)
+{
+ return c < 32 || c >= 128 || c == '&' || c == '<' || c == '>' || c == '\'' || c == '"';
+}
+
void fz_debugtext(fz_text *text, int indent)
{
int i, n;
@@ -118,7 +123,7 @@ void fz_debugtext(fz_text *text, int indent)
{
for (n = 0; n < indent; n++)
putchar(' ');
- if (text->els[i].ucs >= 32 && text->els[i].ucs < 128)
+ if (!isxmlmeta(text->els[i].ucs))
printf("<g ucs=\"%c\" gid=\"%d\" x=\"%g\" y=\"%g\" />\n",
text->els[i].ucs, text->els[i].gid, text->els[i].x, text->els[i].y);
else