Author: mjansen
Date: Mon Apr 17 16:08:38 2017
New Revision: 74353
URL:
http://svn.reactos.org/svn/reactos?rev=74353&view=rev
Log:
[WIN32SS] Add full name support in FontFamilyFillInfo. Patch by Katayama Hirofumi MZ.
CORE-10876
Modified:
trunk/reactos/win32ss/gdi/ntgdi/freetype.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Mon Apr 17 16:08:38 2017
@@ -2090,7 +2090,8 @@
/* Convert UTF-16 big endian to little endian */
SwapEndian(Buf, Name.string_len);
- Status = RtlCreateUnicodeString(pNameW, Buf);
+ RtlCreateUnicodeString(pNameW, Buf);
+ Status = STATUS_SUCCESS;
break;
}
@@ -2111,7 +2112,8 @@
}
static void FASTCALL
-FontFamilyFillInfo(PFONTFAMILYINFO Info, PCWSTR FaceName, PFONTGDI FontGDI)
+FontFamilyFillInfo(PFONTFAMILYINFO Info, LPCWSTR FaceName,
+ LPCWSTR FullName, PFONTGDI FontGDI)
{
ANSI_STRING StyleA;
UNICODE_STRING StyleW;
@@ -2126,7 +2128,9 @@
DWORD fs0;
NTSTATUS status;
FT_Face Face = FontGDI->SharedFace->Face;
-
+ UNICODE_STRING NameW;
+
+ RtlInitUnicodeString(&NameW, NULL);
RtlZeroMemory(Info, sizeof(FONTFAMILYINFO));
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL);
Otm = ExAllocatePoolWithTag(PagedPool, Size, GDITAG_TEXT);
@@ -2189,28 +2193,37 @@
ExFreePoolWithTag(Otm, GDITAG_TEXT);
/* face name */
- /* TODO: full name */
if (FaceName)
{
- RtlStringCbCopyW(Info->EnumLogFontEx.elfLogFont.lfFaceName,
- sizeof(Info->EnumLogFontEx.elfLogFont.lfFaceName),
- FaceName);
- RtlStringCbCopyW(Info->EnumLogFontEx.elfFullName,
- sizeof(Info->EnumLogFontEx.elfFullName),
- FaceName);
+ RtlStringCbCopyW(Lf->lfFaceName, sizeof(Lf->lfFaceName), FaceName);
}
else
{
- UNICODE_STRING NameW;
- RtlInitUnicodeString(&NameW, NULL);
status = IntGetFontLocalizedName(&NameW, Face, TT_NAME_ID_FONT_FAMILY,
gusLanguageID);
if (NT_SUCCESS(status))
{
/* store it */
- RtlStringCbCopyW(Info->EnumLogFontEx.elfLogFont.lfFaceName,
- sizeof(Info->EnumLogFontEx.elfLogFont.lfFaceName),
+ RtlStringCbCopyW(Lf->lfFaceName, sizeof(Lf->lfFaceName),
NameW.Buffer);
+ RtlFreeUnicodeString(&NameW);
+ }
+ }
+
+ /* full name */
+ if (FullName)
+ {
+ RtlStringCbCopyW(Info->EnumLogFontEx.elfFullName,
+ sizeof(Info->EnumLogFontEx.elfFullName),
+ FullName);
+ }
+ else
+ {
+ status = IntGetFontLocalizedName(&NameW, Face, TT_NAME_ID_FULL_NAME,
+ gusLanguageID);
+ if (NT_SUCCESS(status))
+ {
+ /* store it */
RtlStringCbCopyW(Info->EnumLogFontEx.elfFullName,
sizeof(Info->EnumLogFontEx.elfFullName),
NameW.Buffer);
@@ -2371,7 +2384,8 @@
{
if (*Count < Size)
{
- FontFamilyFillInfo(Info + *Count, EntryFaceNameW.Buffer, FontGDI);
+ FontFamilyFillInfo(Info + *Count, EntryFaceNameW.Buffer,
+ NULL, FontGDI);
}
(*Count)++;
}
@@ -2442,7 +2456,7 @@
if (InfoContext->Count < InfoContext->Size)
{
FontFamilyFillInfo(InfoContext->Info + InfoContext->Count,
- RegistryName.Buffer, FontGDI);
+ RegistryName.Buffer, NULL, FontGDI);
}
InfoContext->Count++;
return STATUS_SUCCESS;
@@ -4715,7 +4729,7 @@
IsEqual = FALSE;
FontFamilyFillInfo(&FamInfo[Count], FontEntry->FaceName.Buffer,
- FontEntry->Font);
+ NULL, FontEntry->Font);
for (i = 0; i < Count; ++i)
{
if (EqualFamilyInfo(&FamInfo[i], &FamInfo[Count]))