diff options
author | Tor Lillqvist <tml@iki.fi> | 2000-08-20 22:02:14 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2000-08-20 22:02:14 +0000 |
commit | cd3238a63b904fd0792ca04f1dac7ff04ef98eb4 (patch) | |
tree | 20e3507658937baaf610ef3a48bac98439672255 | |
parent | 1c7f0ddea0ef2f9471a1dd87cebee30443524bd6 (diff) | |
download | pango-cd3238a63b904fd0792ca04f1dac7ff04ef98eb4.tar.gz |
Handle also ft_pixel_mode_mono glyphs.
2000-08-21 Tor Lillqvist <tml@iki.fi>
* pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono
glyphs.
* pango/pangoft2*: Portability enhancements (non-gcc).
* examples/viewer-{ft2,win32}.c: One more 1000 vs. PANGO_SCALE fix.
* pango/module-defs.c.win32: New file.
* pango/Makefile.am: Distribute it.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | ChangeLog.pre-1-0 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 10 | ||||
-rw-r--r-- | examples/makefile.mingw.in | 4 | ||||
-rw-r--r-- | examples/viewer-ft2.c | 2 | ||||
-rw-r--r-- | examples/viewer-win32.c | 2 | ||||
-rw-r--r-- | pango/Makefile.am | 1 | ||||
-rw-r--r-- | pango/module-defs.c.win32 | 7 | ||||
-rw-r--r-- | pango/pangoft2-fontcache.c | 2 | ||||
-rw-r--r-- | pango/pangoft2-fontmap.c | 7 | ||||
-rw-r--r-- | pango/pangoft2-private.h | 6 | ||||
-rw-r--r-- | pango/pangoft2.c | 54 | ||||
-rw-r--r-- | pango/pangowin32-private.h | 7 |
17 files changed, 136 insertions, 26 deletions
@@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 7b433974..f2837949 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 7b433974..f2837949 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 7b433974..f2837949 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 7b433974..f2837949 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 7b433974..f2837949 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 7b433974..f2837949 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,10 @@ +2000-08-21 Tor Lillqvist <tml@iki.fi> + + * pango/pangoft2.c (pango_ft2_render): Handle also ft_pixel_mode_mono + glyphs. + + * pango/pangoft2*: Portability enhancements (non-gcc). + Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> * TODO.xml TODO: Move most all of the TODO items here to the XML file. @@ -44,7 +51,8 @@ Sun Aug 20 13:45:08 2000 Owen Taylor <otaylor@redhat.com> (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} - * pango/pangoft2.def: New file. + * pango/module-defs.c.win32 + * pango/pangoft2.def: New files. * modules/engine.def: Delete. Was duplicate of module.def. diff --git a/examples/makefile.mingw.in b/examples/makefile.mingw.in index cc086b78..69ef74f6 100644 --- a/examples/makefile.mingw.in +++ b/examples/makefile.mingw.in @@ -14,7 +14,7 @@ DEPCFLAGS = $(GTK_CFLAGS) $(GLIB_CFLAGS) $(FREETYPE2_CFLAGS) all : \ ../config.h \ viewer-win32.exe \ - viewer-ft2.exe \ + viewer-ft2.exe ../config.h : ../config.h.win32 cp $< $@ @@ -23,7 +23,7 @@ viewer-win32.exe : viewer-win32.o $(CC) -o $@ $< $(OPTIMIZE) -L ../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GTK_LIBS) $(GLIB_LIBS) -gdi32 viewer-ft2.exe : viewer-ft2.o - $(CC) -mwindows -o $@ $< $(OPTIMIZE) -L ../pango -lpango-$(PANGO_VER) -lpangoft2-$(PANGO_VER) $(FREETYPE2_LIBS) $(GTK_LIBS) $(GLIB_LIBS) + $(CC) -o $@ $< $(OPTIMIZE) -L ../pango -lpango-$(PANGO_VER) -lpangoft2-$(PANGO_VER) $(FREETYPE2_LIBS) $(GTK_LIBS) $(GLIB_LIBS) # Hack to get an updated makefile.mingw automatically after updating # makefile.mingw.in. Only for developer use. diff --git a/examples/viewer-ft2.c b/examples/viewer-ft2.c index e077c525..e7e24bd1 100644 --- a/examples/viewer-ft2.c +++ b/examples/viewer-ft2.c @@ -696,7 +696,7 @@ main (int argc, font_description.variant = PANGO_VARIANT_NORMAL; font_description.weight = PANGO_WEIGHT_NORMAL; font_description.stretch = PANGO_STRETCH_NORMAL; - font_description.size = 24000; + font_description.size = 24 * PANGO_SCALE; pango_context_set_font_description (context, &font_description); diff --git a/examples/viewer-win32.c b/examples/viewer-win32.c index cbfb8033..6ecb41c9 100644 --- a/examples/viewer-win32.c +++ b/examples/viewer-win32.c @@ -650,7 +650,7 @@ main (int argc, char **argv) font_description.variant = PANGO_VARIANT_NORMAL; font_description.weight = 500; font_description.stretch = PANGO_STRETCH_NORMAL; - font_description.size = 16000; + font_description.size = 16 * PANGO_SCALE; pango_context_set_font_description (context, &font_description); diff --git a/pango/Makefile.am b/pango/Makefile.am index df653b17..fb19cd43 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -67,6 +67,7 @@ pango_querymodules_SOURCES = \ pango_querymodules_LDADD = libpangox.la libpango.la $(GLIB_LIBS) $(FRIBIDI_LIBS) $(UNICODE_LIBS) $(X_LIBS) EXTRA_DIST = \ + module-defs.c.win32 \ pangowin32.h \ pangowin32.c \ pangowin32-private.h \ diff --git a/pango/module-defs.c.win32 b/pango/module-defs.c.win32 new file mode 100644 index 00000000..68cb3ead --- /dev/null +++ b/pango/module-defs.c.win32 @@ -0,0 +1,7 @@ +/* Hand-written for Win32. */ + +#include "modules.h" + +PangoIncludedModule _pango_included_modules[] = { + { NULL, NULL, NULL }, +}; diff --git a/pango/pangoft2-fontcache.c b/pango/pangoft2-fontcache.c index 4f7f82b5..62e0f96c 100644 --- a/pango/pangoft2-fontcache.c +++ b/pango/pangoft2-fontcache.c @@ -21,6 +21,8 @@ #include "pangoft2-private.h" +#include <string.h> + /* Font cache */ diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c index a81c8639..a3e99c5d 100644 --- a/pango/pangoft2-fontmap.c +++ b/pango/pangoft2-fontmap.c @@ -21,6 +21,7 @@ #include "config.h" +#include <glib.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> @@ -35,6 +36,12 @@ #include "pango-utils.h" #include "pangoft2-private.h" +#ifdef G_OS_WIN32 +#ifndef S_ISREG +#define S_ISREG(mode) ((mode) & _S_IFREG) +#endif +#endif + #define PANGO_TYPE_FT2_FONT_MAP (pango_ft2_font_map_get_type ()) #define PANGO_FT2_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_FONT_MAP, PangoFT2FontMap)) #define PANGO_FT2_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FT2_FONT_MAP, PangoFT2FontMapClass)) diff --git a/pango/pangoft2-private.h b/pango/pangoft2-private.h index 92b1c053..96be9343 100644 --- a/pango/pangoft2-private.h +++ b/pango/pangoft2-private.h @@ -29,10 +29,16 @@ #define DEBUGGING 1 #ifdef DEBUGGING +#ifdef __GNUC__ #define PING(printlist) \ (g_print ("%s:%d ", __PRETTY_FUNCTION__, __LINE__), \ g_print printlist) #else +#define PING(printlist) \ +(g_print ("%s:%d ", __FILE__, __LINE__), \ + g_print printlist) +#endif +#else #define PING(printlist) #endif diff --git a/pango/pangoft2.c b/pango/pangoft2.c index faffe580..fe55178c 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -317,21 +317,45 @@ pango_ft2_render (FT_Bitmap *bitmap, PING (("xstart:%d xlim:%d ystart:%d ylim:%d\n", x_start, x_limit, y_start, y_limit)); - for (iy = y_start; iy < y_limit; iy++) - { - p = bitmap->buffer + - (iyoff - face->glyph->bitmap_top + iy) * bitmap->pitch + - ixoff + - face->glyph->bitmap_left + x_start; - - q = face->glyph->bitmap.buffer + iy*face->glyph->bitmap.pitch; - for (ix = x_start; ix < x_limit; ix++) - { - *p = MIN (*p, 0xFF - *q); - q++; - p++; - } - } + if (face->glyph->bitmap.pixel_mode == ft_pixel_mode_grays) + for (iy = y_start; iy < y_limit; iy++) + { + p = bitmap->buffer + + (iyoff - face->glyph->bitmap_top + iy) * bitmap->pitch + + ixoff + + face->glyph->bitmap_left + x_start; + + q = face->glyph->bitmap.buffer + iy*face->glyph->bitmap.pitch; + for (ix = x_start; ix < x_limit; ix++) + { + *p = MIN (*p, 0xFF - *q); + q++; + p++; + } + } + else if (face->glyph->bitmap.pixel_mode == ft_pixel_mode_mono) + for (iy = y_start; iy < y_limit; iy++) + { + p = bitmap->buffer + + (iyoff - face->glyph->bitmap_top + iy) * bitmap->pitch + + ixoff + + face->glyph->bitmap_left + x_start; + + q = face->glyph->bitmap.buffer + iy*face->glyph->bitmap.pitch; + for (ix = x_start; ix < x_limit; ix++) + { + if ((*q) & (1 << (7 - (ix%8)))) + *p = 0; + else + *p = MIN (*p, 0xFF); + if ((ix%8) == 7) + q++; + p++; + } + } + else + g_warning ("pango_ft2_render: Unrecognized glyph bitmap pixel mode %d\n", + face->glyph->bitmap.pixel_mode); prev_face = face; prev_index = glyph_index; diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h index 84d1963d..08ab4ac2 100644 --- a/pango/pangowin32-private.h +++ b/pango/pangowin32-private.h @@ -23,10 +23,17 @@ #define __PANGOWIN32_PRIVATE_H__ /* Just for debugging, will be removed */ +#ifdef __GNUC__ #define PING(printlist) \ (g_print ("%s:%d ", __PRETTY_FUNCTION__, __LINE__), \ g_print printlist, \ g_print ("\n")) +#else +#define PING(printlist) \ +(g_print ("%s:%d ", __FILE__, __LINE__), \ + g_print printlist, \ + g_print ("\n")) +#endif #include "pango-modules.h" #include "pangowin32.h" |