OpenTTD Source 20250905-master-g122023be8d
Win32FontCacheFactory Class Reference
Inheritance diagram for Win32FontCacheFactory:
FontCacheFactory

Public Member Functions

std::unique_ptr< FontCacheLoadFont (FontSize fs, FontType fonttype) override
 Loads the GDI font.
 
bool FindFallbackFont (FontCacheSettings *settings, const std::string &language_isocode, MissingGlyphSearcher *callback) override
 

Static Private Member Functions

static std::unique_ptr< FontCacheLoadWin32Font (FontSize fs, const LOGFONT &logfont, uint size, std::string_view font_name)
 
static bool TryLoadFontFromFile (const std::string &font_name, LOGFONT &logfont)
 

Static Private Attributes

static Win32FontCacheFactory instance
 

Additional Inherited Members

- Private Member Functions inherited from FontCacheFactory
 FontCacheFactory (std::string_view name, std::string_view description)
 
- Private Member Functions inherited from BaseProvider< FontCacheFactory >
constexpr BaseProvider (std::string_view name, std::string_view description)
 
std::string_view GetName () const
 
std::string_view GetDescription () const
 
- Private Attributes inherited from BaseProvider< FontCacheFactory >
const std::string_view name
 
const std::string_view description
 

Detailed Description

Definition at line 269 of file font_win32.cpp.

Constructor & Destructor Documentation

◆ Win32FontCacheFactory()

Win32FontCacheFactory::Win32FontCacheFactory ( )
inline

Definition at line 271 of file font_win32.cpp.

Member Function Documentation

◆ FindFallbackFont()

bool Win32FontCacheFactory::FindFallbackFont ( FontCacheSettings settings,
const std::string &  language_isocode,
MissingGlyphSearcher callback 
)
inlineoverridevirtual

Implements FontCacheFactory.

Definition at line 311 of file font_win32.cpp.

◆ LoadFont()

std::unique_ptr< FontCache > Win32FontCacheFactory::LoadFont ( FontSize  fs,
FontType  fonttype 
)
inlineoverridevirtual

Loads the GDI font.

If a GDI font description is present, e.g. from the automatic font fallback search, use it. Otherwise, try to resolve it by font name.

Parameters
fsThe font size to load.

Implements FontCacheFactory.

Definition at line 279 of file font_win32.cpp.

References convert_to_fs(), FS_MONO, GetFontCacheFontName(), GetFontCacheFontSize(), GetFontCacheSubSetting(), settings, StrContainsIgnoreCase(), and TrueType.

◆ LoadWin32Font()

static std::unique_ptr< FontCache > Win32FontCacheFactory::LoadWin32Font ( FontSize  fs,
const LOGFONT &  logfont,
uint  size,
std::string_view  font_name 
)
inlinestaticprivate

Definition at line 337 of file font_win32.cpp.

◆ TryLoadFontFromFile()

static bool Win32FontCacheFactory::TryLoadFontFromFile ( const std::string &  font_name,
LOGFONT &  logfont 
)
inlinestaticprivate

Definition at line 349 of file font_win32.cpp.

Field Documentation

◆ instance

Win32FontCacheFactory Win32FontCacheFactory::instance
staticprivate

Definition at line 399 of file font_win32.cpp.


The documentation for this class was generated from the following file: