summaryrefslogtreecommitdiff
path: root/pango/pango-coverage.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-02-02 04:00:04 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-02-02 04:00:04 +0000
commite709de3de9fb63189624b35022f47dc2665677d2 (patch)
tree860abcf39f910706a6d88867d975084470dc52d0 /pango/pango-coverage.c
parent82d8346691a72e4dd37a1e3999a939be269df32d (diff)
downloadpango-e709de3de9fb63189624b35022f47dc2665677d2.tar.gz
Add a call to get a glyph for unknown an unknown char.
Wed Feb 2 20:49:21 2000 Owen Taylor <otaylor@redhat.com> * libpango/pangox.c (pango_x_get_unknown_glyph): Add a call to get a glyph for unknown an unknown char. * modules/basic/basic.c: use pango_x_get_unknown_glyph. * libpango/utils.[ch] (_pango_guchar4_to_utf8): Added util function for coverting wide chars to utf8. * libpango/pangox.c (pango_x_font_get_coverage pango_x_font_get_shaper): Initial implementations.
Diffstat (limited to 'pango/pango-coverage.c')
-rw-r--r--pango/pango-coverage.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/pango/pango-coverage.c b/pango/pango-coverage.c
index 38bc62ca..d6ce8812 100644
--- a/pango/pango-coverage.c
+++ b/pango/pango-coverage.c
@@ -19,6 +19,8 @@
* Boston, MA 02111-1307, USA.
*/
+#include <string.h>
+
#include <pango-coverage.h>
typedef struct _PangoBlockInfo PangoBlockInfo;
@@ -176,7 +178,7 @@ void pango_coverage_set (PangoCoverage *coverage,
guchar *data;
g_return_if_fail (coverage != NULL);
- g_return_if_fail (level < 0 || level > 3);
+ g_return_if_fail (level >= 0 || level <= 3);
block_index = index / 256;
@@ -189,15 +191,25 @@ void pango_coverage_set (PangoCoverage *coverage,
data = coverage->blocks[block_index].data;
if (!data)
{
+ guchar byte;
+
if (level == coverage->blocks[block_index].level)
return;
- data = g_new0 (guchar, 64);
+ data = g_new (guchar, 64);
coverage->blocks[block_index].data = data;
+
+ byte = coverage->blocks[block_index].level |
+ (coverage->blocks[block_index].level << 2) |
+ (coverage->blocks[block_index].level << 4) |
+ (coverage->blocks[block_index].level << 6);
+
+ for (i=0; i<64; i++)
+ memset (data, byte, 64);
}
i = index % 256;
- data[i] |= level << ((i % 4) * 2);
+ data[i/4] |= level << ((i % 4) * 2);
}
/**