summaryrefslogtreecommitdiff
path: root/modules/basic/basic-win32.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-11-30 21:04:52 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-11-30 21:04:52 +0000
commit86666507ded9c2dd4d89e21c8694d14eabe6c0d9 (patch)
tree237765b634b73f5e113830fa44d8f080188b9837 /modules/basic/basic-win32.c
parent801c16be4a652441d34df85892621470fce58f28 (diff)
downloadpango-86666507ded9c2dd4d89e21c8694d14eabe6c0d9.tar.gz
Define PANGO_VERSION.
2000-11-30 Tor Lillqvist <tml@iki.fi> * pango/makefile.mingw.in (DEFINES): Define PANGO_VERSION. Changes by Hans Breuer: * pango/pango-layout.c (shape_tab): Add a FIXME comment. * pango/pango-markup.c (compare_xcolor_entries): Use g_strcasecmp. * pango/pango-utils.c (pango_get_sysconf_subdirectory): Use second fallback location if there is no pango subdir in the Windows directory. * pango/pangowin32-fontmap.c (pango_win32_font_entry_get_coverage): Check if fopen succeeded. * pango/pangowin32-private.h (DEBUGGING): Turn off. * pango/pangowin32.c (pango_win32_unicode_classify): We can in fact get out of the loop. Return invalid value in that case. (subfont_has_glyph): Improve performance a bit. * pango/querymodules.c: Small change for MSVC build. * modules/basic/basic-win32.c (basic_engine_get_coverage): Performance improvement. * examples/viewer-win32.c (main): Disable double buffering on the layout widget.
Diffstat (limited to 'modules/basic/basic-win32.c')
-rw-r--r--modules/basic/basic-win32.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index a6a4b036..81b0b746 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -98,6 +98,9 @@ find_char (PangoFont *font,
subrange = pango_win32_unicode_classify (wc);
+ if (PANGO_WIN32_U_LAST_PLUS_ONE == subrange)
+ return 0;
+
n_subfonts = pango_win32_list_subfonts (font, subrange, &subfonts);
for (i = 0; i < n_subfonts; i++)
@@ -254,10 +257,44 @@ basic_engine_get_coverage (PangoFont *font,
{
PangoCoverage *result = pango_coverage_new ();
gunichar wc;
+ gint found = 0;
+ gint tested = 0;
+ gint irange = 0;
+ gunichar last;
+#if DEBUGGING
+ GTimeVal tv0, tv1;
+ g_get_current_time (&tv0);
+#endif
+
+ for (irange = 0; irange < G_N_ELEMENTS(basic_ranges); irange++)
+ {
+ for (wc = basic_ranges[irange].start; wc <= basic_ranges[irange].end; wc++)
+ {
+ if (find_char (font, wc))
+ {
+ pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
+ found++;
+ last = wc;
+ }
+ tested++;
+ }
+ }
- for (wc = 0; wc < 65536; wc++)
- if (find_char (font, wc))
- pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
+#if DEBUGGING
+ {
+ PangoFontDescription *desc = pango_font_describe(font);
+
+ g_get_current_time (&tv1);
+ if (tv1.tv_usec < tv0.tv_usec)
+ tv1.tv_sec--, tv1.tv_usec += 1000000L;
+ g_print ("\"%s\" (%d) found: %d tested: %d last: %d time: %ld.%06ld s\n",
+ desc->family_name, desc->weight,
+ found, tested, last,
+ tv1.tv_sec - tv0.tv_sec, tv1.tv_usec - tv0.tv_usec);
+
+ pango_font_description_free (desc);
+ }
+#endif
return result;
}