mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-22 06:01:27 +00:00
#4015 requires sweeping changes in order to allow a migration of our buffer coordinates from `int16_t` to `int32_t`. This commit reduces the size of future commits by using type inference wherever possible, dropping the need to manually adjust types throughout the project later. As an added bonus this commit standardizes the alignment of cv qualifiers to be always left of the type (e.g. `const T&` instead of `T const&`). The migration to type inference with `auto` was mostly done using JetBrains Resharper with some manual intervention and the standardization of cv qualifier alignment using clang-format 14. ## References This is preparation work for #4015. ## Validation Steps Performed * Tests pass ✅
31 lines
906 B
C++
31 lines
906 B
C++
// 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(const unsigned int 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);
|
|
return HRESULT_FROM_NT(status);
|
|
}
|
|
CATCH_RETURN();
|