Commit 618ce03e authored by Albert den Haan's avatar Albert den Haan Committed by Alexandre Julliard

Convert the Unicode Character id to a glyph id in

X11DRV_GetTextExtentPoint.
parent 2ca7b748
......@@ -394,24 +394,24 @@ BOOL X11DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
TRACE("%s %d\n", debugstr_wn(str,count), count);
if( pfo ) {
XChar2b *p = X11DRV_cptable[pfo->fi->cptable].punicode_to_char2b( pfo, str, count );
if (!p) return FALSE;
if( !pfo->lpX11Trans ) {
int dir, ascent, descent;
int info_width;
XChar2b *p = X11DRV_cptable[pfo->fi->cptable].punicode_to_char2b( pfo, str, count );
if (!p) return FALSE;
X11DRV_cptable[pfo->fi->cptable].pTextExtents( pfo, p,
count, &dir, &ascent, &descent, &info_width );
size->cx = abs((info_width + dc->w.breakRem + count *
dc->w.charExtra) * dc->wndExtX / dc->vportExtX);
size->cy = abs((pfo->fs->ascent + pfo->fs->descent) *
dc->wndExtY / dc->vportExtY);
HeapFree( GetProcessHeap(), 0, p );
} else {
INT i;
float x = 0.0, y = 0.0;
/* FIXME: Deal with *_char_or_byte2 != 0 situations */
for(i = 0; i < count; i++) {
x += pfo->fs->per_char ?
pfo->fs->per_char[str[i] - pfo->fs->min_char_or_byte2].attributes :
pfo->fs->per_char[p[i].byte2 - pfo->fs->min_char_or_byte2].attributes :
pfo->fs->min_bounds.attributes;
}
y = pfo->lpX11Trans->RAW_ASCENT + pfo->lpX11Trans->RAW_DESCENT;
......@@ -421,6 +421,7 @@ BOOL X11DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
size->cx = fabs((x + dc->w.breakRem + count * dc->w.charExtra) *
dc->wndExtX / dc->vportExtX);
size->cy = fabs(y * dc->wndExtY / dc->vportExtY);
HeapFree( GetProcessHeap(), 0, p );
}
size->cx *= pfo->rescale;
size->cy *= pfo->rescale;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment