OpenTTD Source 20251213-master-g1091fa6071
CoreTextFontCacheFactory Class Reference
Inheritance diagram for CoreTextFontCacheFactory:
FontCacheFactory BaseProvider< FontCacheFactory >

Public Member Functions

std::unique_ptr< FontCacheLoadFont (FontSize fs, FontType fonttype, bool search, const std::string &font, std::span< const std::byte >) const override
 Loads the TrueType font.
 
bool FindFallbackFont (const std::string &language_isocode, FontSizes fontsizes, MissingGlyphSearcher *callback) const override
 
- Public Member Functions inherited from FontCacheFactory
 FontCacheFactory (std::string_view name, std::string_view description)
 
- Public 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
 

Static Private Member Functions

static CTFontDescriptorRef LoadFontFromFile (const std::string &font_name)
 

Static Private Attributes

static CoreTextFontCacheFactory instance
 

Additional Inherited Members

- Protected Attributes inherited from BaseProvider< FontCacheFactory >
const std::string_view name
 
const std::string_view description
 

Detailed Description

Definition at line 200 of file font_osx.cpp.

Constructor & Destructor Documentation

◆ CoreTextFontCacheFactory()

CoreTextFontCacheFactory::CoreTextFontCacheFactory ( )
inline

Definition at line 202 of file font_osx.cpp.

Member Function Documentation

◆ FindFallbackFont()

bool CoreTextFontCacheFactory::FindFallbackFont ( const std::string &  language_isocode,
FontSizes  fontsizes,
MissingGlyphSearcher callback 
) const
inlineoverridevirtual

Implements FontCacheFactory.

Definition at line 248 of file font_osx.cpp.

◆ LoadFont()

std::unique_ptr< FontCache > CoreTextFontCacheFactory::LoadFont ( FontSize  fs,
FontType  fonttype,
bool  search,
const std::string &  font,
std::span< const std::byte >   
) const
inlineoverridevirtual

Loads the TrueType font.

If a CoreText 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 210 of file font_osx.cpp.

References GetFontCacheFontSize(), MacOSVersionIsAtLeast(), and TrueType.

◆ LoadFontFromFile()

static CTFontDescriptorRef CoreTextFontCacheFactory::LoadFontFromFile ( const std::string &  font_name)
inlinestaticprivate

Definition at line 334 of file font_osx.cpp.

Field Documentation

◆ instance

CoreTextFontCacheFactory CoreTextFontCacheFactory::instance
staticprivate

Definition at line 369 of file font_osx.cpp.


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