Sweden-Number/graphics/ttydrv/font.c

95 lines
2.3 KiB
C
Raw Normal View History

1999-11-24 00:43:29 +01:00
/*
* TTY font driver
*
* Copyright 1999 Patrik Stridvall
*/
#include "dc.h"
#include "debugtools.h"
#include "font.h"
#include "ttydrv.h"
#include "wingdi.h"
DEFAULT_DEBUG_CHANNEL(ttydrv)
/***********************************************************************
* TTYDRV_DC_GetCharWidth
*/
BOOL TTYDRV_DC_GetCharWidth(DC *dc, UINT firstChar, UINT lastChar,
LPINT buffer)
{
UINT c;
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
FIXME("(%p, %u, %u, %p): semistub\n", dc, firstChar, lastChar, buffer);
for(c=firstChar; c<=lastChar; c++) {
buffer[c-firstChar] = physDev->cellWidth;
}
return TRUE;
}
/***********************************************************************
* TTYDRV_DC_GetTextExtentPoint
*/
BOOL TTYDRV_DC_GetTextExtentPoint(DC *dc, LPCSTR str, INT count,
LPSIZE size)
{
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
1999-12-12 00:08:48 +01:00
TRACE("(%p, %s, %d, %p)\n", dc, debugstr_an(str, count), count, size);
1999-11-24 00:43:29 +01:00
size->cx = count * physDev->cellWidth;
size->cy = physDev->cellHeight;
return TRUE;
}
/***********************************************************************
* TTYDRV_DC_GetTextMetrics
*/
BOOL TTYDRV_DC_GetTextMetrics(DC *dc, LPTEXTMETRICA lptm)
{
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
1999-12-12 00:08:48 +01:00
TRACE("(%p, %p)\n", dc, lptm);
1999-11-24 00:43:29 +01:00
lptm->tmHeight = physDev->cellHeight;
lptm->tmAscent = 0;
lptm->tmDescent = 0;
lptm->tmInternalLeading = 0;
lptm->tmExternalLeading = 0;
lptm->tmAveCharWidth = physDev->cellWidth;
lptm->tmMaxCharWidth = physDev->cellWidth;
lptm->tmWeight = FW_MEDIUM;
lptm->tmOverhang = 0;
lptm->tmDigitizedAspectX = physDev->cellWidth;
lptm->tmDigitizedAspectY = physDev->cellHeight;
lptm->tmFirstChar = 32;
lptm->tmLastChar = 255;
lptm->tmDefaultChar = 0;
lptm->tmBreakChar = 32;
lptm->tmItalic = FALSE;
lptm->tmUnderlined = FALSE;
lptm->tmStruckOut = FALSE;
lptm->tmPitchAndFamily = TMPF_FIXED_PITCH|TMPF_DEVICE;
lptm->tmCharSet = ANSI_CHARSET;
return TRUE;
}
/***********************************************************************
* TTYDRV_DC_FONT_SelectObject
*/
HFONT TTYDRV_DC_FONT_SelectObject(DC* dc, HFONT hfont, FONTOBJ *font)
{
1999-12-12 00:08:48 +01:00
HFONT hPreviousFont;
1999-11-24 00:43:29 +01:00
1999-12-12 00:08:48 +01:00
TRACE("(%p, 0x%04x, %p)\n", dc, hfont, font);
hPreviousFont = dc->w.hFont;
dc->w.hFont = hfont;
return hPreviousFont;
1999-11-24 00:43:29 +01:00
}