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
This commit is contained in:
Matt Chapman 2000-10-16 07:37:52 +00:00
parent a7bb5b3af9
commit 71830eeb65
5 changed files with 10 additions and 7 deletions

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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);

View File

@ -76,6 +76,7 @@ typedef struct _BRUSH
typedef struct _FONTGLYPH
{
uint16 offset;
uint16 baseline;
uint16 width;
uint16 height;

2
xwin.c
View File

@ -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,