summaryrefslogtreecommitdiff
path: root/modules/basic/basic-win32.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2001-08-09 05:01:15 +0000
committerAlexander Larsson <alexl@src.gnome.org>2001-08-09 05:01:15 +0000
commit94d2ab7165c8ce889cfd6d237c74b96031ffdb9a (patch)
tree4cfffc75e1d4a8c4645f2d72693672802c1b0bf9 /modules/basic/basic-win32.c
parent53fd91c02a3433a99a1797cc20f5bd7527db414f (diff)
downloadpango-94d2ab7165c8ce889cfd6d237c74b96031ffdb9a.tar.gz
Large rewrite of the win32 backend to use real glyph indexes instead of
2001-08-09 Alexander Larsson <alexl@redhat.com> * pango/pangowin32.h: * pango/pangowin32-private.h: * pango/pangowin32.c: * pango/pangowin32-fontmap.c: * modules/basic/basic-win32.c: * pango/pangowin32.def: Large rewrite of the win32 backend to use real glyph indexes instead of unicode codes. Also drops the subfont thing, thereby simplifying the code immensely. This looses some functionality, but i will add that back soon using global (non backend-specific) aliases. This is the first cut, and is not perfect. It still has some issues and imperfections, but it so clearly better than the current imlementation that I'm checking it in anyway.
Diffstat (limited to 'modules/basic/basic-win32.c')
-rw-r--r--modules/basic/basic-win32.c71
1 files changed, 6 insertions, 65 deletions
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index bd1b6dbe..d0be09ed 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -2,6 +2,7 @@
* basic-win32.c:
*
* Copyright (C) 1999 Red Hat Software
+ * Copyright (C) 2001 Alexander Larsson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -33,6 +34,8 @@ static PangoEngineRange basic_ranges[] = {
{ 0x0591, 0x05f4, "*" }, /* Hebrew */
{ 0x060c, 0x06f9, "" }, /* Arabic */
{ 0x0e01, 0x0e5b, "" }, /* Thai */
+ { 0x10a0, 0x10ff, "*" }, /* Georgian */
+ { 0x1200, 0x16ff, "*" }, /* Ethiopic,Cherokee,Canadian,Ogham,Runic */
{ 0x1e00, 0x1fff, "*" },
{ 0x2000, 0x9fff, "*" },
{ 0xac00, 0xd7a3, "kr" },
@@ -59,29 +62,7 @@ static PangoGlyph
find_char (PangoFont *font,
gunichar wc)
{
- PangoWin32UnicodeSubrange subrange;
- PangoWin32Subfont *subfonts;
- int i;
- int n_subfonts;
-
- 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++)
- {
- PangoGlyph glyph;
-
- glyph = PANGO_WIN32_MAKE_GLYPH (subfonts[i], wc);
-
- if (pango_win32_has_glyph (font, glyph))
- return glyph;
- }
-
- return 0;
+ return pango_win32_font_get_glyph_index (font, wc);
}
static void
@@ -183,6 +164,7 @@ basic_engine_shape (PangoFont *font,
/* Some heuristics to try to guess how overstrike glyphs are
* done and compensate
*/
+ /* FIXME: (alex) Is this double call to get_glyph_extents really necessary? */
pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, &ink_rect, &logical_rect);
if (logical_rect.width == 0 && ink_rect.x == 0)
glyphs->glyphs[i].geometry.x_offset = (glyphs->glyphs[i].geometry.width - ink_rect.width) / 2;
@@ -223,48 +205,7 @@ static PangoCoverage *
basic_engine_get_coverage (PangoFont *font,
PangoLanguage *lang)
{
- 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++;
- }
- }
-
-#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;
+ return pango_font_get_coverage (font, lang);
}
static PangoEngine *