diff options
author | Tor Lillqvist <tml@iki.fi> | 2000-10-03 19:04:34 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2000-10-03 19:04:34 +0000 |
commit | 9b359e9b7c20a134363f2383902519d73d130e68 (patch) | |
tree | bdf8e74a67b9d5783bf2b263662d518d557a7f21 /pango/pangoft2.c | |
parent | 6ed8c4f1d4f27507919db74990fa9bdd3681ad7e (diff) | |
download | pango-9b359e9b7c20a134363f2383902519d73d130e68.tar.gz |
pango/pango.def Add new entry points.
2000-10-03 Tor Lillqvist <tml@iki.fi>
* pango/pango.def
* pango/pangoft2.def: Add new entry points.
* pango/pango-coverage.c (pango_coverage_set): Remove unnecessary
loop calling memset() with same parameters 64 times ;-)
* pango/makefile.mingw.in (PANGO_OBJS): Add pango-tabs.o.
Some small changes that have been laying around on my disk. The
Win32 and FT2 backends aren't "production quality" yet. For
speedup, need to cache at least the coverage info.
* pango/pangoft2.c (pango_ft2_get_coverage): New function.
* modules/basic/basic-win32.c: Use "BasicScriptEngineLangWin32" to
be unique.
* modules/basic/basic-ft2.c: Add comments explaining what Unicode
ranges the table entries covers. Use "BasicScriptEngineLangFT2" to
be unique.
(basic_engine_get_coverage): Test calling
pango_ft2_get_coverage().
(basic_engine_ft2_new): Set corect engine type. Not that this
apparently is used for anything, the X11 basic shaper module also
sets its type as TYPE_LANG.
* examples/viewer-ft2.c (split_paragraphs): Just end the string
upon encountering an invalid character. Don't return.
Diffstat (limited to 'pango/pangoft2.c')
-rw-r--r-- | pango/pangoft2.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pango/pangoft2.c b/pango/pangoft2.c index fe55178c..01f138b5 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -749,6 +749,50 @@ pango_ft2_has_glyph (PangoFont *font, return TRUE; } +PangoCoverage * +pango_ft2_get_coverage (PangoFont *font, + const char *lang) +{ + PangoFT2Font *ft2font = (PangoFT2Font *)font; + PangoCoverage *result = pango_coverage_new (); + PangoCoverage *tmp; + PangoGlyph glyph; + FT_Face face; + gunichar wc; + int i; + GTimeVal tv0, tv1; + + for (i = 1; i <= ft2font->n_fonts; i++) + { + g_get_current_time (&tv0); + tmp = pango_coverage_new (); + face = pango_ft2_get_face (font, i); + g_get_current_time (&tv1); + if (tv1.tv_usec < tv0.tv_usec) + tv1.tv_sec--, tv1.tv_usec += 1000000L; + g_print ("after pango_ft2_get_face: %ld.%06ld s\n", tv1.tv_sec - tv0.tv_sec, tv1.tv_usec - tv0.tv_usec); + for (wc = 0; wc < 65536; wc++) + { + glyph = PANGO_FT2_MAKE_GLYPH (i, wc); + if (FT_Get_Char_Index (face, wc)) + pango_coverage_set (tmp, wc, PANGO_COVERAGE_EXACT); + if ((wc%3000)==1) { + g_get_current_time (&tv1); + if (tv1.tv_usec < tv0.tv_usec) + tv1.tv_sec--, tv1.tv_usec += 1000000L; + g_print ("after %d loops: %ld.%06ld s\n", wc, tv1.tv_sec - tv0.tv_sec, tv1.tv_usec - tv0.tv_usec);} + } + g_get_current_time (&tv1); + if (tv1.tv_usec < tv0.tv_usec) + tv1.tv_sec--, tv1.tv_usec += 1000000L; + g_print ("after loop for %s: %ld.%06ld s\n", face->family_name, tv1.tv_sec - tv0.tv_sec, tv1.tv_usec - tv0.tv_usec); + pango_coverage_max (result, tmp); + pango_coverage_unref (tmp); + } + + return result; +} + /** * pango_ft2_font_subfont_open_args: * @font: a #PangoFont which must be from the FT2 backend |