diff --git a/reactos/include/rosrtl/logfont.h b/reactos/include/rosrtl/logfont.h index 820e798d2be..173fe7288f5 100644 --- a/reactos/include/rosrtl/logfont.h +++ b/reactos/include/rosrtl/logfont.h @@ -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 } diff --git a/reactos/lib/gdi32/objects/text.c b/reactos/lib/gdi32/objects/text.c index 459e2a7e807..f3e393255af 100644 --- a/reactos/lib/gdi32/objects/text.c +++ b/reactos/lib/gdi32/objects/text.c @@ -8,6 +8,7 @@ #include #include #include +#include /* @@ -260,21 +261,11 @@ CreateFontIndirectA( CONST LOGFONTA *lf ) { - ANSI_STRING StringA; - UNICODE_STRING StringU; - HFONT ret; - LOGFONTW tlf; + 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); } diff --git a/reactos/lib/rosrtl/misc/logfont.c b/reactos/lib/rosrtl/misc/logfont.c index 1838ba14960..b281fc9f3ce 100644 --- a/reactos/lib/rosrtl/misc/logfont.c +++ b/reactos/lib/rosrtl/misc/logfont.c @@ -3,7 +3,7 @@ #include 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