summaryrefslogtreecommitdiff
path: root/pango/pangoft2.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-08-20 22:02:14 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-08-20 22:02:14 +0000
commitcd3238a63b904fd0792ca04f1dac7ff04ef98eb4 (patch)
tree20e3507658937baaf610ef3a48bac98439672255 /pango/pangoft2.c
parent1c7f0ddea0ef2f9471a1dd87cebee30443524bd6 (diff)
downloadpango-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.
Diffstat (limited to 'pango/pangoft2.c')
-rw-r--r--pango/pangoft2.c54
1 files changed, 39 insertions, 15 deletions
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;