summaryrefslogtreecommitdiff
path: root/src/cairo-scaled-font-subsets-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2007-02-07 22:35:59 +1030
committerAdrian Johnson <ajohnson@redneon.com>2007-02-07 22:35:59 +1030
commit274dfa4598bcb11b9f8330d23934a4ef1797fdbf (patch)
treed3764d89ddfbbdcebf8d285dabf2a0b2190d0817 /src/cairo-scaled-font-subsets-private.h
parent97a2522e0bbe8464028b9b42c79e0b3559b532be (diff)
downloadcairo-274dfa4598bcb11b9f8330d23934a4ef1797fdbf.tar.gz
PDF: Make text selection and extraction work
- Add a to_unicode array to the scaled_font_subsets for mapping glyphs to unicode characters - Add a function to the TrueType subsetting for performing a reverse cmap for mapping glyph indices to unicode characters. - Add a new scaled font backend function for mapping glyph indices to unicode characters. Provide FreeType and Win32 implementations of the font backend mapping function. - Modify the PDF backend to embed ToUnicode streams into each font. The unicode mapping is obtained by first trying the reverse cmap. If this fails the font backend mapping function is called.
Diffstat (limited to 'src/cairo-scaled-font-subsets-private.h')
-rw-r--r--src/cairo-scaled-font-subsets-private.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/cairo-scaled-font-subsets-private.h b/src/cairo-scaled-font-subsets-private.h
index 2c81fdc63..91148b37e 100644
--- a/src/cairo-scaled-font-subsets-private.h
+++ b/src/cairo-scaled-font-subsets-private.h
@@ -41,18 +41,6 @@
typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
-typedef struct _cairo_scaled_font_subset {
- cairo_scaled_font_t *scaled_font;
- unsigned int font_id;
- unsigned int subset_id;
-
- /* Index of glyphs array is subset_glyph_index.
- * Value of glyphs array is scaled_font_glyph_index.
- */
- unsigned long *glyphs;
- unsigned int num_glyphs;
-} cairo_scaled_font_subset_t;
-
/**
* _cairo_scaled_font_subsets_create:
* @max_glyphs_per_subset: the maximum number of glyphs that should
@@ -361,4 +349,21 @@ _cairo_type1_fallback_init_hex (cairo_type1_subset_t *type_subset,
cairo_private void
_cairo_type1_fallback_fini (cairo_type1_subset_t *subset);
+/**
+ * _cairo_truetype_create_glyph_to_unicode_map:
+ * @font_subset: the #cairo_scaled_font_subset_t to initialize from
+ *
+ * If possible (depending on the format of the underlying
+ * cairo_scaled_font_t and the font backend in use) assign
+ * the unicode character of each glyph in font_subset to
+ * fontsubset->to_unicode.
+ *
+ * Return value: CAIRO_STATUS_SUCCESS if successful,
+ * CAIRO_INT_STATUS_UNSUPPORTED if the unicode encoding of
+ * the glyphs is not available. Possible errors include
+ * CAIRO_STATUS_NO_MEMORY.
+ **/
+cairo_private cairo_int_status_t
+_cairo_truetype_create_glyph_to_unicode_map (cairo_scaled_font_subset_t *font_subset);
+
#endif /* CAIRO_SCALED_FONT_SUBSETS_PRIVATE_H */