OpenTTD Source: src/os/macosx/font_osx.cpp File Reference

OpenTTD Source 13.2.1

Functions | Variables
font_osx.cpp File Reference
`#include "../../stdafx.h"`
`#include "../../debug.h"`
`#include "font_osx.h"`
`#include "../../blitter/factory.hpp"`
`#include "../../fileio_func.h"`
`#include "../../fontdetection.h"`
`#include "../../string_func.h"`
`#include "../../strings_func.h"`
`#include "../../zoom_func.h"`
`#include "macos.h"`
`#include <cmath>`
`#include "../../table/control_codes.h"`
`#include "safeguards.h"`
`#include <ft2build.h>`
`#include <FT_FREETYPE_H>`

Go to the source code of this file.

## Functions
FT_Error | GetFontByFaceName (const char *font_name, FT_Face *face)
| Load a freetype font face with the given font name. More...
bool | SetFallbackFont (FontCacheSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback)
| We would like to have a fallback font as the current one doesn't contain all characters we need. More...
void | LoadCoreTextFont (FontSize fs)
| Loads the TrueType font. More...

## Variables
FT_Library | _library

## Detailed Description

Functions related to font handling on MacOS.

Definition in file font_osx.cpp.

## Function Documentation

## ◆ GetFontByFaceName()

FT_Error GetFontByFaceName | ( | const char * | font_name,
|  | FT_Face * | face
| ) |  |

Load a freetype font face with the given font name.

Parameters

  font_name | The name of the font to load.
  face | The face that has been found.

Returns
  The error we encountered.

Definition at line 35 of file font_osx.cpp.

References Debug, and lengthof.

## ◆ LoadCoreTextFont()

void LoadCoreTextFont | ( | FontSize | fs | ) |

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

  fs | The font size to load.

Definition at line 351 of file font_osx.cpp.

References BASE_DIR, FileExists(), FioFindFullPath(), GetFontCacheSubSetting(), MacOSVersionIsAtLeast(), settings, and ShowInfoF().

## ◆ SetFallbackFont()

bool SetFallbackFont | ( | struct FontCacheSettings * | settings,
|  | const char * | language_isocode,
|  | int | winlangid,
|  | class MissingGlyphSearcher * | callback
| ) |  |

We would like to have a fallback font as the current one doesn't contain all characters we need.

This function must set all fonts of settings.

Parameters

  settings | the settings to overwrite the fontname of.
  language_isocode | the language, e.g. en_GB.
  winlangid | the language ID windows style.
  callback | The function to call to check for missing glyphs.

Returns
  true if a font has been set, false otherwise.

Definition at line 70 of file font_osx.cpp.

References lastof, lengthof, and strecpy().