From 71830eeb65f137f05d7704108c302bc786c0d256 Mon Sep 17 00:00:00 2001 From: Matt Chapman Date: Mon, 16 Oct 2000 07:37:52 +0000 Subject: [PATCH] Respect x offset in font information. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@19 423420c4-83ab-492f-b58f-81f9feb106b5 --- cache.c | 5 +++-- orders.c | 7 ++++--- proto.h | 2 +- types.h | 1 + xwin.c | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cache.c b/cache.c index 965def1..2e4f881 100644 --- a/cache.c +++ b/cache.c @@ -85,8 +85,8 @@ FONTGLYPH *cache_get_font(uint8 font, uint16 character) } /* Store a glyph in the font cache */ -void cache_put_font(uint8 font, uint32 character, uint16 baseline, - uint16 width, uint16 height, HGLYPH pixmap) +void cache_put_font(uint8 font, uint16 character, uint16 offset, + uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap) { FONTGLYPH *glyph; @@ -97,6 +97,7 @@ void cache_put_font(uint8 font, uint32 character, uint16 baseline, if (glyph->pixmap != NULL) ui_destroy_glyph(glyph->pixmap); + glyph->offset = offset; glyph->baseline = baseline; glyph->width = width; glyph->height = height; diff --git a/orders.c b/orders.c index 22bd385..e2ef1f9 100644 --- a/orders.c +++ b/orders.c @@ -722,7 +722,7 @@ static void process_fontcache(STREAM s) { HGLYPH bitmap; uint8 font, nglyphs; - uint16 character, baseline, width, height; + uint16 character, offset, baseline, width, height; uint8 *data, *rev_data, in, out; int i, j, datasize; @@ -734,7 +734,7 @@ static void process_fontcache(STREAM s) for (i = 0; i < nglyphs; i++) { in_uint16_le(s, character); - in_uint8s(s, 2); /* unknown */ + in_uint16_le(s, offset); in_uint16_le(s, baseline); in_uint16_le(s, width); in_uint16_le(s, height); @@ -763,7 +763,8 @@ static void process_fontcache(STREAM s) bitmap = ui_create_glyph(width, height, rev_data); xfree(rev_data); - cache_put_font(font, character, baseline, width, height, bitmap); + cache_put_font(font, character, offset, baseline, + width, height, bitmap); } } diff --git a/proto.h b/proto.h index 4fea04c..5ba10cd 100644 --- a/proto.h +++ b/proto.h @@ -60,7 +60,7 @@ BOOL bitmap_decompress(unsigned char *output, int width, int height, unsigned ch HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx); void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap); FONTGLYPH *cache_get_font(uint8 font, uint16 character); -void cache_put_font(uint8 font, uint32 character, uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap); +void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap); DATABLOB *cache_get_text(uint8 cache_id); void cache_put_text(uint8 cache_id, void *data, int length); uint8 *cache_get_desktop(uint32 offset, int cx, int cy); diff --git a/types.h b/types.h index 7ee5642..a849f06 100644 --- a/types.h +++ b/types.h @@ -76,6 +76,7 @@ typedef struct _BRUSH typedef struct _FONTGLYPH { + uint16 offset; uint16 baseline; uint16 width; uint16 height; diff --git a/xwin.c b/xwin.c index 9a209af..2ad3eca 100644 --- a/xwin.c +++ b/xwin.c @@ -518,7 +518,7 @@ void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, if (glyph != NULL) { - ui_draw_glyph(mixmode, x, + ui_draw_glyph(mixmode, x + (short)glyph->offset, y + (short)glyph->baseline, glyph->width, glyph->height, glyph->pixmap, 0, 0,