mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fix LOGFONT conversion in CreateFontIndirectA()
svn path=/trunk/; revision=8892
This commit is contained in:
parent
014d8e9588
commit
ac44e25672
3 changed files with 8 additions and 17 deletions
|
@ -7,10 +7,10 @@ extern "C"
|
|||
#endif
|
||||
|
||||
void
|
||||
RosRtlLogFontA2W ( LPLOGFONTW pW, const LPLOGFONTA pA );
|
||||
RosRtlLogFontA2W ( LPLOGFONTW pW, const LOGFONTA *pA );
|
||||
|
||||
void
|
||||
RosRtlLogFontW2A ( LPLOGFONTA pA, const LPLOGFONTW pW );
|
||||
RosRtlLogFontW2A ( LPLOGFONTA pA, const LOGFONTW *pW );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <ddk/ntddk.h>
|
||||
#include <win32k/kapi.h>
|
||||
#include <internal/font.h>
|
||||
#include <rosrtl/logfont.h>
|
||||
|
||||
|
||||
/*
|
||||
|
@ -260,21 +261,11 @@ CreateFontIndirectA(
|
|||
CONST LOGFONTA *lf
|
||||
)
|
||||
{
|
||||
ANSI_STRING StringA;
|
||||
UNICODE_STRING StringU;
|
||||
HFONT ret;
|
||||
LOGFONTW tlf;
|
||||
|
||||
RtlInitAnsiString(&StringA, (LPSTR)lf->lfFaceName);
|
||||
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
|
||||
memcpy(&tlf, lf, sizeof(LOGFONTA));
|
||||
memcpy(&tlf.lfFaceName, &StringU.Buffer, StringU.Length);
|
||||
RosRtlLogFontA2W(&tlf, lf);
|
||||
|
||||
ret = CreateFontIndirectW(&tlf);
|
||||
|
||||
RtlFreeUnicodeString(&StringU);
|
||||
|
||||
return ret;
|
||||
return NtGdiCreateFontIndirect(&tlf);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <rosrtl/logfont.h>
|
||||
|
||||
void
|
||||
RosRtlLogFontA2W ( LPLOGFONTW pW, const LPLOGFONTA pA )
|
||||
RosRtlLogFontA2W ( LPLOGFONTW pW, const LOGFONTA *pA )
|
||||
{
|
||||
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
|
||||
#define COPYN(f) pW->f = pA->f
|
||||
|
@ -28,7 +28,7 @@ RosRtlLogFontA2W ( LPLOGFONTW pW, const LPLOGFONTA pA )
|
|||
}
|
||||
|
||||
void
|
||||
RosRtlLogFontW2A ( LPLOGFONTA pA, const LPLOGFONTW pW )
|
||||
RosRtlLogFontW2A ( LPLOGFONTA pA, const LOGFONTW *pW )
|
||||
{
|
||||
#define COPYS(f,len) WideCharToMultiByte ( CP_THREAD_ACP, 0, pW->f, len, pA->f, len, NULL, NULL )
|
||||
#define COPYN(f) pA->f = pW->f
|
||||
|
|
Loading…
Reference in a new issue