Moved GetTextMetrics to unicode.

This commit is contained in:
Huw D M Davies 2001-03-16 16:43:14 +00:00 committed by Alexandre Julliard
parent 07b6e6e62e
commit 39f54283fc
10 changed files with 40 additions and 39 deletions

View File

@ -442,7 +442,7 @@ BOOL TTYDRV_DC_GetTextExtentPoint(DC *dc, LPCWSTR str, INT count,
/***********************************************************************
* TTYDRV_DC_GetTextMetrics
*/
BOOL TTYDRV_DC_GetTextMetrics(DC *dc, LPTEXTMETRICA lptm)
BOOL TTYDRV_DC_GetTextMetrics(DC *dc, LPTEXTMETRICW lptm)
{
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;

View File

@ -88,7 +88,7 @@ extern BOOL TTYDRV_DC_GetCharWidth(struct tagDC *dc, UINT firstChar, UINT lastCh
extern COLORREF TTYDRV_DC_GetPixel(struct tagDC *dc, INT x, INT y);
extern BOOL TTYDRV_DC_GetTextExtentPoint(struct tagDC *dc, LPCWSTR str, INT count, LPSIZE size);
extern BOOL TTYDRV_DC_GetTextMetrics(struct tagDC *dc, TEXTMETRICA *metrics);
extern BOOL TTYDRV_DC_GetTextMetrics(struct tagDC *dc, TEXTMETRICW *metrics);
extern BOOL TTYDRV_DC_LineTo(struct tagDC *dc, INT x, INT y);
extern BOOL TTYDRV_DC_PaintRgn(struct tagDC *dc, HRGN hrgn);
extern BOOL TTYDRV_DC_PatBlt(struct tagDC *dc, INT left, INT top, INT width, INT height, DWORD rop);

View File

@ -166,7 +166,7 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
/***********************************************************************
* PSDRV_GetTextMetrics
*/
BOOL PSDRV_GetTextMetrics(DC *dc, TEXTMETRICA *metrics)
BOOL PSDRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;

View File

@ -192,13 +192,13 @@ typedef struct {
} PSCOLOR;
typedef struct {
AFM *afm;
TEXTMETRICA tm;
INT size;
float scale;
INT escapement;
PSCOLOR color;
BOOL set; /* Have we done a setfont yet */
AFM *afm;
TEXTMETRICW tm;
INT size;
float scale;
INT escapement;
PSCOLOR color;
BOOL set; /* Have we done a setfont yet */
} PSFONT;
typedef struct {
@ -339,7 +339,7 @@ extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
LPINT buffer );
extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
LPSIZE size );
extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
extern BOOL PSDRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics );
extern BOOL PSDRV_LineTo( DC *dc, INT x, INT y );
extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
dwRop);

View File

@ -50,13 +50,13 @@ BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR wstr, INT count,
/***********************************************************************
* WIN16DRV_GetTextMetrics
*/
BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics )
BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
TRACE("%04x \n", dc->hSelf);
FONT_TextMetric16ToA( &physDev->tm, metrics );
FONT_TextMetric16ToW( &physDev->tm, metrics );
TRACE(
"H %ld, A %ld, D %ld, Int %ld, Ext %ld, AW %ld, MW %ld, W %ld\n",

View File

@ -3176,15 +3176,16 @@ BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
/***********************************************************************
* X11DRV_GetTextMetrics
*/
BOOL X11DRV_GetTextMetrics(DC *dc, TEXTMETRICA *metrics)
BOOL X11DRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
TEXTMETRICA tmA;
if( CHECK_PFONT(physDev->font) )
{
fontObject* pfo = __PFONT(physDev->font);
X11DRV_cptable[pfo->fi->cptable].pGetTextMetricsA( pfo, metrics );
X11DRV_cptable[pfo->fi->cptable].pGetTextMetricsA( pfo, &tmA );
FONT_TextMetricAToW(&tmA, metrics);
return TRUE;
}
return FALSE;

View File

@ -202,7 +202,7 @@ typedef struct tagDC_FUNCS
COLORREF (*pGetPixel)(DC*,INT,INT);
INT (*pGetPixelFormat)(DC*);
BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
BOOL (*pGetTextMetrics)(DC*,TEXTMETRICA*);
BOOL (*pGetTextMetrics)(DC*,TEXTMETRICW*);
INT (*pIntersectClipRect)(DC*,INT,INT,INT,INT);
BOOL (*pInvertRgn)(DC*,HRGN);
BOOL (*pLineTo)(DC*,INT,INT);

View File

@ -211,7 +211,7 @@ extern BOOL WIN16DRV_GetCharWidth( struct tagDC *dc, UINT firstChar, UINT lastCh
extern BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
LPSIZE size );
extern BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics );
extern BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics );
extern BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
const RECT *lprect, LPCWSTR str, UINT count,

View File

@ -99,7 +99,7 @@ extern BOOL X11DRV_GetCharWidth( struct tagDC *dc, UINT firstChar,
extern BOOL X11DRV_GetDCOrgEx( struct tagDC *dc, LPPOINT lpp );
extern BOOL X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCWSTR str,
INT count, LPSIZE size );
extern BOOL X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRICA *metrics);
extern BOOL X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRICW *metrics);
extern BOOL X11DRV_PatBlt( struct tagDC *dc, INT left, INT top,
INT width, INT height, DWORD rop );
extern VOID X11DRV_SetDeviceClipping(struct tagDC *dc);

View File

@ -1173,10 +1173,10 @@ done:
*/
BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
{
TEXTMETRICA tm32;
TEXTMETRICW tm32;
if (!GetTextMetricsA( (HDC)hdc, &tm32 )) return FALSE;
FONT_TextMetricATo16( &tm32, metrics );
if (!GetTextMetricsW( (HDC)hdc, &tm32 )) return FALSE;
FONT_TextMetricWTo16( &tm32, metrics );
return TRUE;
}
@ -1185,7 +1185,19 @@ BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
* GetTextMetricsA (GDI32.@)
*/
BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics )
{
{
TEXTMETRICW tm32;
if (!GetTextMetricsW( hdc, &tm32 )) return FALSE;
FONT_TextMetricWToA( &tm32, metrics );
return TRUE;
}
/***********************************************************************
* GetTextMetricsW (GDI32.@)
*/
BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
{
BOOL ret = FALSE;
DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE;
@ -1213,10 +1225,10 @@ BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics )
ret = TRUE;
TRACE("text metrics:\n"
" Weight = %03li\t FirstChar = %03i\t AveCharWidth = %li\n"
" Italic = % 3i\t LastChar = %03i\t\t MaxCharWidth = %li\n"
" UnderLined = %01i\t DefaultChar = %03i\t Overhang = %li\n"
" StruckOut = %01i\t BreakChar = %03i\t CharSet = %i\n"
" Weight = %03li\t FirstChar = %i\t AveCharWidth = %li\n"
" Italic = % 3i\t LastChar = %i\t\t MaxCharWidth = %li\n"
" UnderLined = %01i\t DefaultChar = %i\t Overhang = %li\n"
" StruckOut = %01i\t BreakChar = %i\t CharSet = %i\n"
" PitchAndFamily = %02x\n"
" --------------------\n"
" InternalLeading = %li\n"
@ -1238,18 +1250,6 @@ BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics )
}
/***********************************************************************
* GetTextMetricsW (GDI32.@)
*/
BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
{
TEXTMETRICA tm;
if (!GetTextMetricsA( (HDC16)hdc, &tm )) return FALSE;
FONT_TextMetricAToW( &tm, metrics );
return TRUE;
}
/***********************************************************************
* GetOutlineTextMetrics16 [GDI.308] Gets metrics for TrueType fonts.
*