diff options
author | Tor Lillqvist <tml@novell.com> | 2005-04-28 17:20:05 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-04-28 17:20:05 +0000 |
commit | 3fc02e41c1efd23af4eb0e34af0fd6fa2783ead6 (patch) | |
tree | f65fd16983d0eae7d3d4fcc2fcf5dce17e2b133d /pango/pangowin32-private.h | |
parent | 6aee1049a38fc25f25e2ed14a6ed303cc647556a (diff) | |
download | pango-3fc02e41c1efd23af4eb0e34af0fd6fa2783ead6.tar.gz |
Correct parameters passed to MultiByteToWideChar(). Pass -1 as source
2005-04-28 Tor Lillqvist <tml@novell.com>
* pango/pangocairo-win32font.c (pango_cairo_win32_font_get_font_face):
Correct parameters passed to MultiByteToWideChar(). Pass -1 as
source string length so that the target string gets
zero-terminated. Size of target array is in number of WCHARs, not
number of bytes.
Add support to pangowin32 for TrueType fonts with coverage outside
the BMP. Fix handling of surrogate pairs in the Uniscribe
shaper. (#302238)
* pango/pangowin32-private.h (PangoWin32Face): Rename the
unicode_table field to cmap. Keep track of its format (4 or 12).
(format_12_cmap): Add struct for a format 12 cmap.
* pango/pangowin32.c: Corresponding changes. Rename internal
functions a bit.
(get_format_12_cmap): New function, reads a format 12 cmap.
(font_get_cmap): Look for both format 12 (which is preferred) and
format 4 cmaps.
(pango_win32_font_get_glyph_index,
pango_win32_font_calc_coverage): Handle also format 12 cmaps.
* modules/basic/basic-win32.c: Handle surrogate pairs in wchar_t
strings properly.
(unichar_index): New function. Given a wchar_t string and an index
into it, calculate the index of the corresponding Unicode
character. Each surrogate pair in the wchar_t is just one Unicode
character.
(set_up_pango_log_clusters, itemize_shape_and_place): Use
unichar_index() instead of direct index into wchar_t string.
Diffstat (limited to 'pango/pangowin32-private.h')
-rw-r--r-- | pango/pangowin32-private.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h index 6bb1389e..40916e4f 100644 --- a/pango/pangowin32-private.h +++ b/pango/pangowin32-private.h @@ -161,7 +161,8 @@ struct _PangoWin32Face PangoCoverage *coverages[PANGO_WIN32_N_COVERAGES]; char *face_name; - gpointer unicode_table; + guint16 cmap_format; + gpointer cmap; GSList *cached_fonts; }; @@ -194,15 +195,17 @@ struct _PangoWin32GlyphInfo #define UNICODE_ENCODING_ID 1 #define UCS4_ENCODING_ID 10 +/* All the below structs must be packed! */ + struct cmap_encoding_subtable -{ /* Must be packed! */ +{ guint16 platform_id; guint16 encoding_id; guint32 offset; }; -struct type_4_cmap -{ /* Must be packed! */ +struct format_4_cmap +{ guint16 format; guint16 length; guint16 language; @@ -216,6 +219,17 @@ struct type_4_cmap guint16 arrays[1]; }; +struct format_12_cmap +{ + guint16 format; + guint16 reserved; + guint32 length; + guint32 language; + guint32 count; + + guint32 groups[1]; +}; + struct name_header { guint16 format_selector; |