OpenTTD
string_osx.h File Reference

Functions related to localized text support on OSX. More...

#include "../../gfx_layout.h"
#include "../../string_base.h"
#include <vector>

Go to the source code of this file.

Data Structures

class  OSXStringIterator
 String iterator using CoreText as a backend. More...
 
struct  OSXStringIterator::CharInfo
 Break info for a character. More...
 
class  CoreTextParagraphLayoutFactory
 Helper class to construct a new CoreTextParagraphLayout. More...
 

Functions

void MacOSResetScriptCache (FontSize size)
 Delete CoreText font reference for a specific font size. More...
 
void MacOSSetCurrentLocaleName (const char *iso_code)
 Store current language locale as a CoreFounation locale. More...
 
int MacOSStringCompare (const char *s1, const char *s2)
 Compares two strings using case insensitive natural sort. More...
 

Detailed Description

Functions related to localized text support on OSX.

Definition in file string_osx.h.

Function Documentation

◆ MacOSResetScriptCache()

void MacOSResetScriptCache ( FontSize  size)

Delete CoreText font reference for a specific font size.

Definition at line 271 of file string_osx.cpp.

References _font_cache.

Referenced by CoreTextParagraphLayoutFactory::AppendToBuffer(), and Layouter::ResetFontCache().

◆ MacOSSetCurrentLocaleName()

void MacOSSetCurrentLocaleName ( const char *  iso_code)

Store current language locale as a CoreFounation locale.

Definition at line 280 of file string_osx.cpp.

References _osx_locale, and MacOSVersionIsAtLeast().

Referenced by CoreTextParagraphLayoutFactory::AppendToBuffer().

◆ MacOSStringCompare()

int MacOSStringCompare ( const char *  s1,
const char *  s2 
)

Compares two strings using case insensitive natural sort.

Parameters
s1First string to compare.
s2Second string to compare.
Returns
1 if s1 < s2, 2 if s1 == s2, 3 if s1 > s2, or 0 if not supported by the OS.

Definition at line 298 of file string_osx.cpp.

References _osx_locale, and MacOSVersionIsAtLeast().

Referenced by CoreTextParagraphLayoutFactory::AppendToBuffer().