summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Larsson <alexl@redhat.com>2001-12-12 02:59:52 +0000
committerAlexander Larsson <alexl@src.gnome.org>2001-12-12 02:59:52 +0000
commitbcf6c7a607dbce17ed36e8596b0a9465a7711e0a (patch)
tree3697ec955a6231aa7cc37fb51352289d39ef3058
parenta05b5bfdadf2013f19779781028e5e85cdab3657 (diff)
downloadpango-bcf6c7a607dbce17ed36e8596b0a9465a7711e0a.tar.gz
Fix the details in clipping to the bitmap size.
2001-12-11 Alex Larsson <alexl@redhat.com> * pango/pangoft2.c (pango_ft2_render): Fix the details in clipping to the bitmap size.
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-1-05
-rw-r--r--ChangeLog.pre-1-105
-rw-r--r--ChangeLog.pre-1-25
-rw-r--r--ChangeLog.pre-1-45
-rw-r--r--ChangeLog.pre-1-65
-rw-r--r--ChangeLog.pre-1-85
-rw-r--r--pango/pangoft2.c42
8 files changed, 55 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog.pre-1-0
+++ b/ChangeLog.pre-1-0
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog.pre-1-2
+++ b/ChangeLog.pre-1-2
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index a2854ec2..26fe1c1d 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,8 @@
+2001-12-11 Alex Larsson <alexl@redhat.com>
+
+ * pango/pangoft2.c (pango_ft2_render):
+ Fix the details in clipping to the bitmap size.
+
Mon Dec 10 14:22:22 2001 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/tables-big.i: change "EUC-CN" to "GB2312" which
diff --git a/pango/pangoft2.c b/pango/pangoft2.c
index fc62b6f7..7ef2930c 100644
--- a/pango/pangoft2.c
+++ b/pango/pangoft2.c
@@ -280,7 +280,7 @@ pango_ft2_render (FT_Bitmap *bitmap,
int x_position = 0;
int ix, iy, ixoff, iyoff, y_start, y_limit, x_start, x_limit;
PangoGlyphInfo *gi;
- guchar *p, *q;
+ guchar *dest, *src;
g_return_if_fail (bitmap != NULL);
g_return_if_fail (glyphs != NULL);
@@ -305,12 +305,11 @@ pango_ft2_render (FT_Bitmap *bitmap,
ixoff = x + PANGO_PIXELS (x_position + gi->geometry.x_offset);
iyoff = y + PANGO_PIXELS (gi->geometry.y_offset);
- x_start = MAX (0, -face->glyph->bitmap_left - ixoff);
- x_limit = MIN (face->glyph->bitmap.width, face->glyph->bitmap_left - ixoff + bitmap->width);
-
- y_start = MAX (0, face->glyph->bitmap_top - iyoff);
- y_limit = MIN (face->glyph->bitmap.rows, face->glyph->bitmap_top - iyoff + bitmap->rows);
+ x_start = MAX (0, - (ixoff + face->glyph->bitmap_left));
+ x_limit = MIN (face->glyph->bitmap.width, bitmap->width - (ixoff + face->glyph->bitmap_left));
+ y_start = MAX (0, - (iyoff - face->glyph->bitmap_top));
+ y_limit = MIN (face->glyph->bitmap.rows, bitmap->rows - (iyoff - face->glyph->bitmap_top));
PING (("glyph %d:%d: bitmap: %dx%d, left:%d top:%d",
i, glyph_index,
@@ -322,48 +321,47 @@ pango_ft2_render (FT_Bitmap *bitmap,
if (face->glyph->bitmap.pixel_mode == ft_pixel_mode_grays)
for (iy = y_start; iy < y_limit; iy++)
{
- p = bitmap->buffer +
+ dest = bitmap->buffer +
(iyoff - face->glyph->bitmap_top + iy) * bitmap->pitch +
- ixoff + face->glyph->bitmap_left +
- x_start;
+ ixoff + face->glyph->bitmap_left + x_start;
- q = face->glyph->bitmap.buffer +
- iy * face->glyph->bitmap.pitch;
+ src = face->glyph->bitmap.buffer +
+ iy * face->glyph->bitmap.pitch + x_start;
for (ix = x_start; ix < x_limit; ix++)
{
- switch (*q)
+ switch (*src)
{
case 0:
break;
case 0xff:
- *p = 0xff;
+ *dest = 0xff;
default:
- *p = MIN ((gushort) *p + (gushort) *q, 0xff);
+ *dest = MIN ((gushort) *dest + (gushort) *src, 0xff);
break;
}
- q++;
- p++;
+ dest++;
+ src++;
}
}
else if (face->glyph->bitmap.pixel_mode == ft_pixel_mode_mono)
for (iy = y_start; iy < y_limit; iy++)
{
- p = bitmap->buffer +
+ dest = bitmap->buffer +
(iyoff - face->glyph->bitmap_top + iy) * bitmap->pitch +
ixoff + face->glyph->bitmap_left +
x_start;
- q = face->glyph->bitmap.buffer +
+ src = face->glyph->bitmap.buffer +
iy*face->glyph->bitmap.pitch;
for (ix = x_start; ix < x_limit; ix++)
{
- if ((*q) & (1 << (7 - (ix % 8))))
- *p = 0xff;
+ if ((*src) & (1 << (7 - (ix % 8))))
+ *dest |= (1 << (7 - (ix % 8)));
if ((ix % 8) == 7)
- q++;
- p++;
+ src++;
+ dest++;
}
}
else