summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-operators.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2010-11-10 20:09:53 +1030
committerAdrian Johnson <ajohnson@redneon.com>2010-11-10 20:09:53 +1030
commit3afd7cd031ab9097e37c3e89d86ec41d015fdeb8 (patch)
tree1e22cfafabc0a2c36e74fd9a646ae3fc4d2a7882 /src/cairo-pdf-operators.c
parent7ee313d7b86b8c9eeaa5bf9b42a47d3f1feaeeee (diff)
downloadcairo-3afd7cd031ab9097e37c3e89d86ec41d015fdeb8.tar.gz
PDF: Restrict ActualText to PDF version >= 1.5
The use of ActualText in a marked content sequence is a PDF 1.5 feature. A 'use_actual_text' flag linked to the PDF version has already been implemented in pdf-operators but for some reason this flag had not been used to control the use of ActualText.
Diffstat (limited to 'src/cairo-pdf-operators.c')
-rw-r--r--src/cairo-pdf-operators.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index ab206270e..bbaa3ebb2 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -1366,7 +1366,7 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t *pdf_operators,
{
cairo_scaled_font_subsets_glyph_t subset_glyph;
cairo_glyph_t *cur_glyph;
- cairo_status_t status;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
int i;
/* If the cluster maps 1 glyph to 1 or more unicode characters, we
@@ -1401,15 +1401,17 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t *pdf_operators,
}
}
- /* Fallback to using ActualText to map zero or more glyphs to a
- * unicode string. */
- status = _cairo_pdf_operators_flush_glyphs (pdf_operators);
- if (unlikely (status))
- return status;
+ if (pdf_operators->use_actual_text) {
+ /* Fallback to using ActualText to map zero or more glyphs to a
+ * unicode string. */
+ status = _cairo_pdf_operators_flush_glyphs (pdf_operators);
+ if (unlikely (status))
+ return status;
- status = _cairo_pdf_operators_begin_actualtext (pdf_operators, utf8, utf8_len);
- if (unlikely (status))
- return status;
+ status = _cairo_pdf_operators_begin_actualtext (pdf_operators, utf8, utf8_len);
+ if (unlikely (status))
+ return status;
+ }
cur_glyph = glyphs;
/* XXX
@@ -1434,11 +1436,14 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t *pdf_operators,
else
cur_glyph++;
}
- status = _cairo_pdf_operators_flush_glyphs (pdf_operators);
- if (unlikely (status))
- return status;
- status = _cairo_pdf_operators_end_actualtext (pdf_operators);
+ if (pdf_operators->use_actual_text) {
+ status = _cairo_pdf_operators_flush_glyphs (pdf_operators);
+ if (unlikely (status))
+ return status;
+
+ status = _cairo_pdf_operators_end_actualtext (pdf_operators);
+ }
return status;
}