summaryrefslogtreecommitdiff
path: root/pango/Makefile.am
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2005-11-08 04:36:11 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2005-11-08 04:36:11 +0000
commitf03772dc687d1b157036ebe65872bae6a5507cbf (patch)
tree96876ae035a576e75e9393f7acd4e0db061461f3 /pango/Makefile.am
parentd7157323acccf40ca481aa43be8b1a71bd1f79ac (diff)
downloadpango-f03772dc687d1b157036ebe65872bae6a5507cbf.tar.gz
Fixes bug #320666:
2005-11-07 Federico Mena Quintero <federico@ximian.com> Fixes bug #320666: Instead of doing a bsearch() for every gunichar to map it to a PangoScript, use a precomputed table for the first 8192 code points. Also, remember the last script that we computed on each invocation; this will also help CJK and the other scripts above U+2000. This table also holds information on whether the characters in it are paired characters. We can use this to avoid doing the expensive get_pair_index() call most of the time. Many thanks to Matthias Clasen for his suggestions for this patch. * tools/gen-easy-scripts-table.c: New program to generate pango_easy_scripts_table. * tools/Makefile.am: Build gen-easy-scripts-table. * pango/pango-easy-scripts-table.h: New file with a mapping of the first 8192 Unicode characters to their corresponding scripts. The table also says whether each character has a paired char or not. * pango/Makefile.am (libpango_1_0_la_SOURCES): Add pango-easy-scripts-table.h. * pango/pango-script-table.h: Remove everything below U+2000, and add a note to that effect. * pango/pango-script.c (pango_script_for_unichar_with_last_index): New function. This is the old pango_script_for_unichar(), but it lets the caller keep around the computed index in pango_script_table. This works under the assumption that a character is likely to be in the same script block as the preceding character in a string. (pango_script_for_unichar): First, do a quick check against the pango_easy_scripts_table. Then, do the expensive check with pango_script_for_unichar_with_last_index(). (pango_script_iter_next): If the character is within the easy script range, find out if it is a paired character by using PANGO_PAIRED_CHAR_FLAG. (struct _PangoScriptIter): Add a last_index_for_script_lookup field. We use this to maintain the last-lookup index from pango_script_for_unichar_with_last_index(). (pango_script_iter_next): If the character is not within the easy script range, use pango_script_for_unichar_with_last_index(), and store the index in the last_index_for_script_lookup field of the PangoScriptIter.
Diffstat (limited to 'pango/Makefile.am')
-rw-r--r--pango/Makefile.am63
1 files changed, 32 insertions, 31 deletions
diff --git a/pango/Makefile.am b/pango/Makefile.am
index da89b91e..7800eb76 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -57,37 +57,38 @@ endif
pango-win32-res.o: pango.rc
$(WINDRES) $< $@
-libpango_1_0_la_SOURCES = \
- break.c \
- ellipsize.c \
- fonts.c \
- glyphstring.c \
- mapping.c \
- modules.c \
- pango-attributes.c \
- pango-color.c \
- pango-color-table.h \
- pango-context.c \
- pango-coverage.c \
- pango-engine.c \
- pango-engine-private.h \
- pango-fontmap.c \
- pango-fontset.c \
- pango-glyph-item.c \
- pango-glyph-item-private.h \
- pango-impl-utils.h \
- pango-item.c \
- pango-layout.c \
- pango-layout-private.h \
- pango-markup.c \
- pango-renderer.c \
- pango-script.c \
- pango-script-lang-table.h \
- pango-script-table.h \
- pango-tabs.c \
- pango-utils.c \
- reorder-items.c \
- shape.c \
+libpango_1_0_la_SOURCES = \
+ break.c \
+ ellipsize.c \
+ fonts.c \
+ glyphstring.c \
+ mapping.c \
+ modules.c \
+ pango-attributes.c \
+ pango-color.c \
+ pango-color-table.h \
+ pango-context.c \
+ pango-coverage.c \
+ pango-easy-scripts-table.h \
+ pango-engine.c \
+ pango-engine-private.h \
+ pango-fontmap.c \
+ pango-fontset.c \
+ pango-glyph-item.c \
+ pango-glyph-item-private.h \
+ pango-impl-utils.h \
+ pango-item.c \
+ pango-layout.c \
+ pango-layout-private.h \
+ pango-markup.c \
+ pango-renderer.c \
+ pango-script.c \
+ pango-script-lang-table.h \
+ pango-script-table.h \
+ pango-tabs.c \
+ pango-utils.c \
+ reorder-items.c \
+ shape.c \
pango-enum-types.c
pango_headers = \