diff options
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | ChangeLog.pre-1-0 | 22 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 22 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 22 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 22 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 22 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 22 | ||||
-rw-r--r-- | examples/makefile.mingw | 2 | ||||
-rw-r--r-- | examples/viewer-win32.c | 5 | ||||
-rw-r--r-- | modules/Makefile.am | 3 | ||||
-rw-r--r-- | modules/basic/Makefile.am | 3 | ||||
-rw-r--r-- | modules/basic/basic-win32.c | 66 | ||||
-rw-r--r-- | modules/basic/makefile.mingw | 2 | ||||
-rw-r--r-- | modules/module.def | 4 | ||||
-rw-r--r-- | pango/Makefile.am | 7 | ||||
-rw-r--r-- | pango/makefile.mingw | 4 | ||||
-rw-r--r-- | pango/pangowin32-fontmap.c | 10 | ||||
-rw-r--r-- | pango/pangowin32-private.h | 2 | ||||
-rw-r--r-- | pango/pangowin32.c | 12 | ||||
-rw-r--r-- | pango/pangox.c | 4 |
20 files changed, 196 insertions, 82 deletions
@@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 93c75e4f..2dadeb4a 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 93c75e4f..2dadeb4a 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 93c75e4f..2dadeb4a 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 93c75e4f..2dadeb4a 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 93c75e4f..2dadeb4a 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 93c75e4f..2dadeb4a 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,25 @@ +2000-07-18 Tor Lillqvist <tml@iki.fi> + + * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. + + * pango/pangox.c (lang_texts): Add some Latin-1 to the + Finnish and Swedish strings. + + * modules/module.def: New file. + + * modules/Makefile.am (EXTRA_DIST): Add it. + + * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. + + * */makefile.mingw: Small updates. + + * pango/pangowin32.c + * pango/pangowin32-fontmap.c + * modules/basic/basic-win32.c + * examples/viewer-win32.c: Bug fixes. Remove dead code. + Now the Win32 implementation seems to work, except + for a few glitches. + 2000-07-16 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.h diff --git a/examples/makefile.mingw b/examples/makefile.mingw index 259e02af..b20101d0 100644 --- a/examples/makefile.mingw +++ b/examples/makefile.mingw @@ -18,5 +18,5 @@ all : \ cp $< $@ viewer-win32.exe : viewer-win32.o - $(CC) -o $@ $< -L ../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GTK_LIBS) $(GLIB_LIBS) -gdi32 + $(CC) -o $@ $< $(OPTIMIZE) -L ../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GTK_LIBS) $(GLIB_LIBS) -gdi32 diff --git a/examples/viewer-win32.c b/examples/viewer-win32.c index f5007a7d..969b6e9b 100644 --- a/examples/viewer-win32.c +++ b/examples/viewer-win32.c @@ -126,9 +126,6 @@ split_paragraphs (char *text) Paragraph *para = g_new (Paragraph, 1); para->text = last_para; para->length = p - last_para; - /* Don't include the newline */ - if (wc == '\n') - para->length--; para->layout = pango_layout_new (context); pango_layout_set_text (para->layout, para->text, para->length); para->height = 0; @@ -302,7 +299,7 @@ draw (GtkWidget *layout, GdkRectangle *area) if (height + para->height >= GTK_LAYOUT (layout)->yoffset + area->y) { - GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND; + GdkGCValuesMask mask = GDK_GC_FOREGROUND|GDK_GC_BACKGROUND|GDK_GC_FONT; HDC hdc; hdc = gdk_win32_hdc_get (GTK_LAYOUT (layout)->bin_window, diff --git a/modules/Makefile.am b/modules/Makefile.am index 0e7737cc..80092322 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -14,3 +14,6 @@ install-data-local: $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/pango $(top_builddir)/pango/pango-querymodules $(DESTDIR)$(libdir)/pango/modules/*.so \ > $(DESTDIR)$(sysconfdir)/pango/pango.modules + +EXTRA_DIST = \ + module.def diff --git a/modules/basic/Makefile.am b/modules/basic/Makefile.am index b69b6671..db21f28c 100644 --- a/modules/basic/Makefile.am +++ b/modules/basic/Makefile.am @@ -20,4 +20,5 @@ libpango_basic_la_SOURCES = $(sources) EXTRA_DIST = \ tables-big.i \ - tables-small.i
\ No newline at end of file + tables-small.i \ + basic-win32.c diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index bf669a24..410fa971 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -24,16 +24,6 @@ #include "pangowin32.h" #include <fribidi/fribidi.h> -typedef struct _CharCache CharCache; - -#define MAX_CHARSETS 32 - -struct _CharCache -{ - int n_subfonts; - PangoWin32Subfont *subfonts; -}; - static PangoEngineRange basic_ranges[] = { /* Language characters */ { 0x0000, 0x02af, "*" }, @@ -97,27 +87,8 @@ basic_engine_lang_new () * Win32 system script engine portion */ -static CharCache * -char_cache_new (void) -{ - CharCache *result; - int i; - - result = g_new (CharCache, 1); - result->subfonts = NULL; - - return result; -} - -static void -char_cache_free (CharCache *cache) -{ - g_free (cache->subfonts); - g_free (cache); -} - static PangoGlyph -find_char (CharCache *cache, PangoFont *font, gunichar wc) +find_char (PangoFont *font, gunichar wc) { PangoWin32UnicodeSubrange subrange; PangoWin32Subfont *subfonts; @@ -177,22 +148,6 @@ swap_range (PangoGlyphString *glyphs, int start, int end) } } -static CharCache * -get_char_cache (PangoFont *font) -{ - GQuark cache_id = g_quark_from_string ("basic-char-cache"); - - CharCache *cache = g_object_get_qdata (G_OBJECT (font), cache_id); - if (!cache) - { - cache = char_cache_new (); - g_object_set_qdata_full (G_OBJECT (font), cache_id, - cache, (GDestroyNotify)char_cache_free); - } - - return cache; -} - static void basic_engine_shape (PangoFont *font, const char *text, @@ -204,15 +159,11 @@ basic_engine_shape (PangoFont *font, int i; const char *p; - CharCache *cache; - g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); g_return_if_fail (length >= 0); g_return_if_fail (analysis != NULL); - cache = get_char_cache (font); - n_chars = g_utf8_strlen (text, length); pango_glyph_string_set_size (glyphs, n_chars); @@ -222,20 +173,12 @@ basic_engine_shape (PangoFont *font, gunichar wc; FriBidiChar mirrored_ch; PangoGlyph index; - char buf[6]; - const char *input; wc = g_utf8_get_char (p); - input = p; if (analysis->level % 2) if (fribidi_get_mirror_char (wc, &mirrored_ch)) - { - wc = mirrored_ch; - - g_unichar_to_utf8 (wc, buf); - input = buf; - } + wc = mirrored_ch; if (wc == 0x200B || wc == 0x200E || wc == 0x200F) /* Zero-width characters */ { @@ -243,7 +186,7 @@ basic_engine_shape (PangoFont *font, } else { - index = find_char (cache, font, wc); + index = find_char (font, wc); if (index) { set_glyph (font, glyphs, i, p - text, index); @@ -302,12 +245,11 @@ static PangoCoverage * basic_engine_get_coverage (PangoFont *font, const char *lang) { - CharCache *cache = get_char_cache (font); PangoCoverage *result = pango_coverage_new (); gunichar wc; for (wc = 0; wc < 65536; wc++) - if (find_char (cache, font, wc)) + if (find_char (font, wc)) pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT); return result; diff --git a/modules/basic/makefile.mingw b/modules/basic/makefile.mingw index 60377b99..43d48465 100644 --- a/modules/basic/makefile.mingw +++ b/modules/basic/makefile.mingw @@ -18,4 +18,4 @@ all : \ cp $< $@ pango-basic-win32.dll : basic-win32.o - $(GLIB)/build-dll pango-basic-win32 - ../engine.def $< -L ../../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GLIB_LIBS) $(FRIBIDI_LIBS) + $(GLIB)/build-dll pango-basic-win32 - ../module.def $< -L ../../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GLIB_LIBS) $(FRIBIDI_LIBS) diff --git a/modules/module.def b/modules/module.def new file mode 100644 index 00000000..23572855 --- /dev/null +++ b/modules/module.def @@ -0,0 +1,4 @@ +EXPORTS + script_engine_list + script_engine_load + script_engine_unload diff --git a/pango/Makefile.am b/pango/Makefile.am index 99888ace..ee780e98 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -66,3 +66,10 @@ pango_querymodules_SOURCES = \ querymodules.c pango_querymodules_LDADD = libpangox.la libpango.la $(GLIB_LIBS) $(FRIBIDI_LIBS) $(UNICODE_LIBS) $(X_LIBS) +EXTRA_DIST = \ + pangowin32.h \ + pangowin32.c \ + pangowin32-private.h \ + pangowin32-fontcache.c \ + pangowin32-fontmap.c + diff --git a/pango/makefile.mingw b/pango/makefile.mingw index e32f72f0..63ef30ea 100644 --- a/pango/makefile.mingw +++ b/pango/makefile.mingw @@ -48,10 +48,10 @@ module-defs.c : module-defs.c.win32 cp $< $@ pango-$(PANGO_VER).dll : $(PANGO_OBJS) pango.def - $(GLIB)/build-dll pango $(PANGO_VER) pango.def $(PANGO_OBJS) $(GLIB_LIBS) $(LIBICONV_LIBS) $(FRIBIDI_LIBS) + $(GLIB)/build-dll pango $(PANGO_VER) pango.def $(OPTIMIZE) $(PANGO_OBJS) $(GLIB_LIBS) $(LIBICONV_LIBS) $(FRIBIDI_LIBS) pangowin32-$(PANGO_VER).dll : $(PANGOWIN32_OBJS) pangowin32.def - $(GLIB)/build-dll pangowin32 $(PANGO_VER) pangowin32.def $(PANGOWIN32_OBJS) -L . -lpango-$(PANGO_VER) $(GLIB_LIBS) $(FRIBIDI_LIBS) -lgdi32 + $(GLIB)/build-dll pangowin32 $(PANGO_VER) pangowin32.def $(OPTIMIZE) $(PANGOWIN32_OBJS) -L . -lpango-$(PANGO_VER) $(GLIB_LIBS) $(FRIBIDI_LIBS) -lgdi32 pango-querymodules.exe : $(PANGO_QUERYMODULES_OBJS) pango-$(PANGO_VER).dll pangowin32-$(PANGO_VER).dll $(CC) -o $@ $(PANGO_QUERYMODULES_OBJS) -L . -lpango-$(PANGO_VER) $(GLIB_LIBS) diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index a7b6cde4..85298885 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -235,6 +235,7 @@ PangoFontMap * pango_win32_font_map_for_display (void) { LOGFONT logfont; + RECT rect; /* Make sure that the type system is initialized */ g_type_init(); @@ -253,7 +254,10 @@ pango_win32_font_map_for_display (void) pango_win32_font_map_read_aliases (fontmap); - fontmap->resolution = 0; /* ??? */ + SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); + fontmap->resolution = + (PANGO_SCALE * 72.27 / 25.4) * ((double) GetDeviceCaps (pango_win32_hdc, HORZSIZE) / + (rect.right - rect.left)); return PANGO_FONT_MAP (fontmap); } @@ -1056,6 +1060,8 @@ pango_win32_font_map_read_alias_file (PangoWin32FontMap *win32fontmap, else font_entry->lfp[i].lfWeight = FW_HEAVY; + font_entry->lfp[i].lfQuality = ANTIALIASED_QUALITY; + /* Stretch ? */ /* Charset is ignored anyway when used with the widechar @@ -1324,7 +1330,9 @@ pango_win32_make_matching_logfont (PangoFontMap *fontmap, /* OK, we have a match; let's modify it to fit this size */ result = g_new (LOGFONT, 1); + *result = *closest_match; result->lfHeight = (int)((double)size / win32fontmap->resolution + 0.5); + result->lfWidth = 0; } return result; diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h index 78d459a3..15c849b7 100644 --- a/pango/pangowin32-private.h +++ b/pango/pangowin32-private.h @@ -35,8 +35,6 @@ #define FS_VIETNAMESE 0x100 #endif -#define PANGO_NOTE(x) x - typedef struct _PangoWin32Font PangoWin32Font; typedef struct _PangoWin32FontEntry PangoWin32FontEntry; typedef struct _PangoWin32SubfontInfo PangoWin32SubfontInfo; diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 2147fef2..a07ca509 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -926,7 +926,7 @@ pango_win32_list_subfonts (PangoFont *font, gboolean subfont_has_glyph (PangoWin32SubfontInfo *info, - wchar_t c) + wchar_t wc) { struct { @@ -936,6 +936,7 @@ subfont_has_glyph (PangoWin32SubfontInfo *info, DIBSECTION ds; TEXTMETRIC tm; HFONT hfont; + wchar_t default_wc; if (info->buf_hbm == NULL) { @@ -980,8 +981,8 @@ subfont_has_glyph (PangoWin32SubfontInfo *info, FillRect (info->buf_hdc, &info->buf_rect, white_brush); info->oldfont = SelectObject (info->buf_hdc, hfont); - c = tm.tmDefaultChar; - TextOutW (info->buf_hdc, info->buf_x, info->buf_y, &c, 1); + default_wc = tm.tmDefaultChar; + TextOutW (info->buf_hdc, info->buf_x, info->buf_y, &default_wc, 1); info->buf_hbm = CreateDIBSection (info->buf_hdc, (BITMAPINFO *)&bmi, @@ -995,8 +996,7 @@ subfont_has_glyph (PangoWin32SubfontInfo *info, * does not exist in the font. */ FillRect (info->buf_hdc, &info->buf_rect, white_brush); - TextOutW (info->buf_hdc, info->buf_x, info->buf_y, - &c, 1); + TextOutW (info->buf_hdc, info->buf_x, info->buf_y, &wc, 1); return (memcmp (info->buf, info->default_char_buf, info->buf_size) != 0); } @@ -1018,7 +1018,6 @@ pango_win32_has_glyph (PangoFont *font, PangoWin32SubfontInfo *info; guint16 char_index = PANGO_WIN32_GLYPH_INDEX (glyph); guint16 subfont_index = PANGO_WIN32_GLYPH_SUBFONT (glyph); - wchar_t c; info = pango_win32_find_subfont (font, subfont_index); if (!info) @@ -1193,6 +1192,7 @@ pango_win32_find_glyph (PangoFont *font, if (!subfont_has_glyph (info, char_index)) return FALSE; + hfont = pango_win32_get_hfont (font, info); oldfont = SelectObject (pango_win32_hdc, hfont); GetTextExtentPoint32W (pango_win32_hdc, &char_index, 1, &size); SelectObject (pango_win32_hdc, oldfont); diff --git a/pango/pangox.c b/pango/pangox.c index c9388fef..7aa3b638 100644 --- a/pango/pangox.c +++ b/pango/pangox.c @@ -574,7 +574,7 @@ LangInfo lang_texts[] = { { "eo", "Esperanto Saluton" }, { "es", "Spanish (Español) ¡Hola!" }, { "et", "Estonian Tere, Tervist" }, - { "fi", "Finnish (Suomi) Hei" }, + { "fi", "Finnish (Suomi) Hei, Hyvää päivää" }, { "fr", "French (Français)" }, { "de", "German Grüß Gott" }, { "iw", "Hebrew שלום" }, @@ -587,7 +587,7 @@ LangInfo lang_texts[] = { { "pl", "Polish Dzień dobry, Hej" }, { "ru", "Russian (Русский)" }, { "sk", "Slovak Dobrý deň" }, - { "sv", "Swedish (Svenska) Hej, Goddag" }, + { "sv", "Swedish (Svenska) Hej på dej, Goddag" }, { "tr", "Turkish (Türkçe) Merhaba" }, { "zh", "Chinese (中文,普通话,汉语)" } }; |