summaryrefslogtreecommitdiff
path: root/src/cairo-truetype-subset-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-truetype-subset-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-truetype-subset-private.h')
-rw-r--r--src/cairo-truetype-subset-private.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/cairo-truetype-subset-private.h b/src/cairo-truetype-subset-private.h
index e9b2c47e4..80baa2837 100644
--- a/src/cairo-truetype-subset-private.h
+++ b/src/cairo-truetype-subset-private.h
@@ -65,6 +65,29 @@
#define TT_TAG_prep MAKE_TT_TAG('p','r','e','p')
/* All tt_* structs are big-endian */
+typedef struct _tt_cmap_index {
+ uint16_t platform;
+ uint16_t encoding;
+ uint32_t offset;
+} tt_cmap_index_t;
+
+typedef struct _tt_cmap {
+ uint16_t version;
+ uint16_t num_tables;
+ tt_cmap_index_t index[];
+} tt_cmap_t;
+
+typedef struct _segment_map {
+ uint16_t format;
+ uint16_t length;
+ uint16_t version;
+ uint16_t segCountX2;
+ uint16_t searchRange;
+ uint16_t entrySelector;
+ uint16_t rangeShift;
+ uint16_t endCount[];
+} tt_segment_map_t;
+
typedef struct _tt_head {
int16_t version_1;
int16_t version_2;