- Notifications
You must be signed in to change notification settings - Fork 8.5k
/
Copy pathrenderFontDefaults.cpp
30 lines (24 loc) · 906 Bytes
/
renderFontDefaults.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include"precomp.h"
#include"renderFontDefaults.hpp"
#pragma hdrstop
RenderFontDefaults::RenderFontDefaults()
{
LOG_IF_NTSTATUS_FAILED(TrueTypeFontList::s_Initialize());
}
RenderFontDefaults::~RenderFontDefaults()
{
LOG_IF_FAILED(TrueTypeFontList::s_Destroy());
}
[[nodiscard]] HRESULT RenderFontDefaults::RetrieveDefaultFontNameForCodepage(constunsignedint codePage,
std::wstring& outFaceName)
try
{
// GH#3123: Propagate font length changes up through Settings and propsheet
wchar_t faceName[LF_FACESIZE]{ 0 };
auto status = TrueTypeFontList::s_SearchByCodePage(codePage, faceName, ARRAYSIZE(faceName));
outFaceName.assign(faceName);
returnHRESULT_FROM_NT(status);
}
CATCH_RETURN();