summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-04-16 21:48:20 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-04-16 21:48:20 +0000
commitbfcc49fb69f964898d6f10ada2c7c4d8169f077d (patch)
tree81b26b123c74cb5f98838b883cd014109f4c666c
parent7a8933dbb5d3c3b342f565aef85f20112b447231 (diff)
downloadpango-bfcc49fb69f964898d6f10ada2c7c4d8169f077d.tar.gz
More careful handling of face->charmap; if is NULL, try to set a unicode
Wed Apr 16 03:46:42 2003 Owen Taylor <otaylor@redhat.com> * pango/opentype/pango-ot-info.c (synthesize_class_def): More careful handling of face->charmap; if is NULL, try to set a unicode charmap, if that doesn't succeed, return. (Hopefully fixes #106550)
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-1-107
-rw-r--r--ChangeLog.pre-1-47
-rw-r--r--ChangeLog.pre-1-67
-rw-r--r--ChangeLog.pre-1-87
-rw-r--r--pango/opentype/pango-ot-info.c26
6 files changed, 59 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 661445c5..8779b85b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Apr 16 03:46:42 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/pango-ot-info.c (synthesize_class_def):
+ More careful handling of face->charmap; if is NULL,
+ try to set a unicode charmap, if that doesn't succeed,
+ return. (Hopefully fixes #106550)
+
Tue Apr 15 11:49:39 2003 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxg{sub/pos}.c: When loading
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 661445c5..8779b85b 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,10 @@
+Wed Apr 16 03:46:42 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/pango-ot-info.c (synthesize_class_def):
+ More careful handling of face->charmap; if is NULL,
+ try to set a unicode charmap, if that doesn't succeed,
+ return. (Hopefully fixes #106550)
+
Tue Apr 15 11:49:39 2003 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxg{sub/pos}.c: When loading
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index 661445c5..8779b85b 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,10 @@
+Wed Apr 16 03:46:42 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/pango-ot-info.c (synthesize_class_def):
+ More careful handling of face->charmap; if is NULL,
+ try to set a unicode charmap, if that doesn't succeed,
+ return. (Hopefully fixes #106550)
+
Tue Apr 15 11:49:39 2003 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxg{sub/pos}.c: When loading
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 661445c5..8779b85b 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,10 @@
+Wed Apr 16 03:46:42 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/pango-ot-info.c (synthesize_class_def):
+ More careful handling of face->charmap; if is NULL,
+ try to set a unicode charmap, if that doesn't succeed,
+ return. (Hopefully fixes #106550)
+
Tue Apr 15 11:49:39 2003 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxg{sub/pos}.c: When loading
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 661445c5..8779b85b 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,10 @@
+Wed Apr 16 03:46:42 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/opentype/pango-ot-info.c (synthesize_class_def):
+ More careful handling of face->charmap; if is NULL,
+ try to set a unicode charmap, if that doesn't succeed,
+ return. (Hopefully fixes #106550)
+
Tue Apr 15 11:49:39 2003 Owen Taylor <otaylor@redhat.com>
* pango/opentype/ftxg{sub/pos}.c: When loading
diff --git a/pango/opentype/pango-ot-info.c b/pango/opentype/pango-ot-info.c
index 1c55f2e0..8827e657 100644
--- a/pango/opentype/pango-ot-info.c
+++ b/pango/opentype/pango-ot-info.c
@@ -175,6 +175,21 @@ get_glyph_class (gunichar charcode)
}
}
+static gboolean
+set_unicode_charmap (FT_Face face)
+{
+ int charmap;
+
+ for (charmap = 0; charmap < face->num_charmaps; charmap++)
+ if (face->charmaps[charmap]->encoding == ft_encoding_unicode)
+ {
+ FT_Error error = FT_Set_Charmap(face, face->charmaps[charmap]);
+ return error == FT_Err_Ok;
+ }
+
+ return FALSE;
+}
+
/* Synthesize a GDEF table using the font's charmap and the
* unicode property database. We'll fill in class definitions
* for glyphs not in the charmap as we walk through the tables.
@@ -188,9 +203,13 @@ synthesize_class_def (PangoOTInfo *info)
FT_ULong charcode;
FT_UInt glyph;
int i, j;
+ FT_CharMap old_charmap;
- if (info->face->charmap->encoding != ft_encoding_unicode)
- return;
+ old_charmap = info->face->charmap;
+
+ if (!old_charmap || !old_charmap->encoding != ft_encoding_unicode)
+ if (!set_unicode_charmap (info->face))
+ return;
glyph_infos = g_array_new (FALSE, FALSE, sizeof (GlyphInfo));
@@ -240,6 +259,9 @@ synthesize_class_def (PangoOTInfo *info)
g_free (glyph_indices);
g_free (classes);
+
+ if (old_charmap && info->face->charmap != old_charmap)
+ FT_Set_Charmap (info->face, old_charmap);
}
TTO_GDEF