Moved GetTextMetrics to unicode.
This commit is contained in:
parent
07b6e6e62e
commit
39f54283fc
|
@ -442,7 +442,7 @@ BOOL TTYDRV_DC_GetTextExtentPoint(DC *dc, LPCWSTR str, INT count,
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* TTYDRV_DC_GetTextMetrics
|
* 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;
|
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
||||||
|
|
||||||
|
|
|
@ -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 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_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_LineTo(struct tagDC *dc, INT x, INT y);
|
||||||
extern BOOL TTYDRV_DC_PaintRgn(struct tagDC *dc, HRGN hrgn);
|
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);
|
extern BOOL TTYDRV_DC_PatBlt(struct tagDC *dc, INT left, INT top, INT width, INT height, DWORD rop);
|
||||||
|
|
|
@ -166,7 +166,7 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* PSDRV_GetTextMetrics
|
* PSDRV_GetTextMetrics
|
||||||
*/
|
*/
|
||||||
BOOL PSDRV_GetTextMetrics(DC *dc, TEXTMETRICA *metrics)
|
BOOL PSDRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
|
||||||
{
|
{
|
||||||
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
AFM *afm;
|
AFM *afm;
|
||||||
TEXTMETRICA tm;
|
TEXTMETRICW tm;
|
||||||
INT size;
|
INT size;
|
||||||
float scale;
|
float scale;
|
||||||
INT escapement;
|
INT escapement;
|
||||||
|
@ -339,7 +339,7 @@ extern BOOL PSDRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
|
||||||
LPINT buffer );
|
LPINT buffer );
|
||||||
extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
|
extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
|
||||||
LPSIZE size );
|
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_LineTo( DC *dc, INT x, INT y );
|
||||||
extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
|
extern BOOL PSDRV_PatBlt( DC *dc, INT x, INT y, INT width, INT height, DWORD
|
||||||
dwRop);
|
dwRop);
|
||||||
|
|
|
@ -50,13 +50,13 @@ BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR wstr, INT count,
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* WIN16DRV_GetTextMetrics
|
* WIN16DRV_GetTextMetrics
|
||||||
*/
|
*/
|
||||||
BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics )
|
BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICW *metrics )
|
||||||
{
|
{
|
||||||
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
|
||||||
|
|
||||||
TRACE("%04x \n", dc->hSelf);
|
TRACE("%04x \n", dc->hSelf);
|
||||||
|
|
||||||
FONT_TextMetric16ToA( &physDev->tm, metrics );
|
FONT_TextMetric16ToW( &physDev->tm, metrics );
|
||||||
|
|
||||||
TRACE(
|
TRACE(
|
||||||
"H %ld, A %ld, D %ld, Int %ld, Ext %ld, AW %ld, MW %ld, W %ld\n",
|
"H %ld, A %ld, D %ld, Int %ld, Ext %ld, AW %ld, MW %ld, W %ld\n",
|
||||||
|
|
|
@ -3176,15 +3176,16 @@ BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_GetTextMetrics
|
* X11DRV_GetTextMetrics
|
||||||
*/
|
*/
|
||||||
BOOL X11DRV_GetTextMetrics(DC *dc, TEXTMETRICA *metrics)
|
BOOL X11DRV_GetTextMetrics(DC *dc, TEXTMETRICW *metrics)
|
||||||
{
|
{
|
||||||
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
||||||
|
TEXTMETRICA tmA;
|
||||||
|
|
||||||
if( CHECK_PFONT(physDev->font) )
|
if( CHECK_PFONT(physDev->font) )
|
||||||
{
|
{
|
||||||
fontObject* pfo = __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 TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -202,7 +202,7 @@ typedef struct tagDC_FUNCS
|
||||||
COLORREF (*pGetPixel)(DC*,INT,INT);
|
COLORREF (*pGetPixel)(DC*,INT,INT);
|
||||||
INT (*pGetPixelFormat)(DC*);
|
INT (*pGetPixelFormat)(DC*);
|
||||||
BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
|
BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
|
||||||
BOOL (*pGetTextMetrics)(DC*,TEXTMETRICA*);
|
BOOL (*pGetTextMetrics)(DC*,TEXTMETRICW*);
|
||||||
INT (*pIntersectClipRect)(DC*,INT,INT,INT,INT);
|
INT (*pIntersectClipRect)(DC*,INT,INT,INT,INT);
|
||||||
BOOL (*pInvertRgn)(DC*,HRGN);
|
BOOL (*pInvertRgn)(DC*,HRGN);
|
||||||
BOOL (*pLineTo)(DC*,INT,INT);
|
BOOL (*pLineTo)(DC*,INT,INT);
|
||||||
|
|
|
@ -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,
|
extern BOOL WIN16DRV_GetTextExtentPoint( DC *dc, LPCWSTR str, INT count,
|
||||||
LPSIZE size );
|
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,
|
extern BOOL WIN16DRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
|
||||||
const RECT *lprect, LPCWSTR str, UINT count,
|
const RECT *lprect, LPCWSTR str, UINT count,
|
||||||
|
|
|
@ -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_GetDCOrgEx( struct tagDC *dc, LPPOINT lpp );
|
||||||
extern BOOL X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCWSTR str,
|
extern BOOL X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCWSTR str,
|
||||||
INT count, LPSIZE size );
|
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,
|
extern BOOL X11DRV_PatBlt( struct tagDC *dc, INT left, INT top,
|
||||||
INT width, INT height, DWORD rop );
|
INT width, INT height, DWORD rop );
|
||||||
extern VOID X11DRV_SetDeviceClipping(struct tagDC *dc);
|
extern VOID X11DRV_SetDeviceClipping(struct tagDC *dc);
|
||||||
|
|
|
@ -1173,10 +1173,10 @@ done:
|
||||||
*/
|
*/
|
||||||
BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
|
BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
|
||||||
{
|
{
|
||||||
TEXTMETRICA tm32;
|
TEXTMETRICW tm32;
|
||||||
|
|
||||||
if (!GetTextMetricsA( (HDC)hdc, &tm32 )) return FALSE;
|
if (!GetTextMetricsW( (HDC)hdc, &tm32 )) return FALSE;
|
||||||
FONT_TextMetricATo16( &tm32, metrics );
|
FONT_TextMetricWTo16( &tm32, metrics );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1185,7 +1185,19 @@ BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
|
||||||
* GetTextMetricsA (GDI32.@)
|
* GetTextMetricsA (GDI32.@)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics )
|
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;
|
BOOL ret = FALSE;
|
||||||
DC * dc = DC_GetDCPtr( hdc );
|
DC * dc = DC_GetDCPtr( hdc );
|
||||||
if (!dc) return FALSE;
|
if (!dc) return FALSE;
|
||||||
|
@ -1213,10 +1225,10 @@ BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics )
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
TRACE("text metrics:\n"
|
TRACE("text metrics:\n"
|
||||||
" Weight = %03li\t FirstChar = %03i\t AveCharWidth = %li\n"
|
" Weight = %03li\t FirstChar = %i\t AveCharWidth = %li\n"
|
||||||
" Italic = % 3i\t LastChar = %03i\t\t MaxCharWidth = %li\n"
|
" Italic = % 3i\t LastChar = %i\t\t MaxCharWidth = %li\n"
|
||||||
" UnderLined = %01i\t DefaultChar = %03i\t Overhang = %li\n"
|
" UnderLined = %01i\t DefaultChar = %i\t Overhang = %li\n"
|
||||||
" StruckOut = %01i\t BreakChar = %03i\t CharSet = %i\n"
|
" StruckOut = %01i\t BreakChar = %i\t CharSet = %i\n"
|
||||||
" PitchAndFamily = %02x\n"
|
" PitchAndFamily = %02x\n"
|
||||||
" --------------------\n"
|
" --------------------\n"
|
||||||
" InternalLeading = %li\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.
|
* GetOutlineTextMetrics16 [GDI.308] Gets metrics for TrueType fonts.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue