MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / HFontFromFont

Function HFontFromFont

src/os/windows/string_uniscribe.cpp:142–153  ·  view source on GitHub ↗

Load the matching native Windows font. */

Source from the content-addressed store, hash-verified

140
141/** Load the matching native Windows font. */
142static HFONT HFontFromFont(Font *font)
143{
144 if (font->fc->GetOSHandle() != nullptr) return CreateFontIndirect(reinterpret_cast<PLOGFONT>(const_cast<void *>(font->fc->GetOSHandle())));
145
146 LOGFONT logfont{};
147 logfont.lfHeight = font->fc->GetHeight();
148 logfont.lfWeight = FW_NORMAL;
149 logfont.lfCharSet = DEFAULT_CHARSET;
150 convert_to_fs(font->fc->GetFontName(), logfont.lfFaceName);
151
152 return CreateFontIndirect(&logfont);
153}
154
155/** Determine the glyph positions for a run. */
156static bool UniscribeShapeRun(const UniscribeParagraphLayoutFactory::CharType *buff, UniscribeRun &range)

Callers 1

UniscribeShapeRunFunction · 0.85

Calls 4

convert_to_fsFunction · 0.85
GetOSHandleMethod · 0.45
GetHeightMethod · 0.45
GetFontNameMethod · 0.45

Tested by

no test coverage detected