|
OpenTTD Source
14.0-beta1
|
#include "stdafx.h"#include "fontcache.h"#include "fontdetection.h"#include "blitter/factory.hpp"#include "gfx_layout.h"#include "fontcache/spritefontcache.h"#include "openttd.h"#include "settings_func.h"#include "strings_func.h"#include "viewport_func.h"#include "window_func.h"#include "fileio_func.h"#include "safeguards.h"Go to the source code of this file.
Functions | |
| int | GetCharacterHeight (FontSize size) |
| Get height of a character for a given font size. More... | |
| bool | GetFontAAState (FontSize size, bool check_blitter) |
| void | SetFont (FontSize fontsize, const std::string &font, uint size, bool aa) |
| void | LoadFreeTypeFont (FontSize fs) |
| Loads the freetype font. More... | |
| void | LoadFreeTypeFont (FontSize fs, const std::string &file_name, uint size) |
| Load a TrueType font from a file. More... | |
| void | UninitFreeType () |
| Free everything allocated w.r.t. More... | |
| static void | TryLoadDefaultTrueTypeFont ([[maybe_unused]] FontSize fs) |
| void | InitFontCache (bool monospace) |
| (Re)initialize the font cache related things, i.e. More... | |
| void | UninitFontCache () |
| Free everything allocated w.r.t. More... | |
| bool | HasAntialiasedFonts () |
| Should any of the active fonts be anti-aliased? More... | |
Variables | |
| static const int | _default_font_height [FS_END] = {10, 6, 18, 10} |
| Default heights for the different sizes of fonts. | |
| static const int | _default_font_ascender [FS_END] = { 8, 5, 15, 8} |
| FontCacheSettings | _fcsettings |
Cache for characters from fonts.
Definition in file fontcache.cpp.
| int GetCharacterHeight | ( | FontSize | size | ) |
Get height of a character for a given font size.
| size | Font size to get height of |
Definition at line 78 of file fontcache.cpp.
References FontCache::Get(), and FontCache::GetHeight().
Referenced by TextfileWindow::CheckHyperlinkClick(), CargoesField::Draw(), StationViewWindow::DrawAcceptedCargo(), TownAuthorityWindow::DrawActions(), StationViewWindow::DrawCargoRatings(), DrawCategory(), NetworkClientListWindow::DrawCompany(), NetworkContentListWindow::DrawDetails(), DrawFrame(), IndustryViewWindow::DrawInfo(), NetworkContentListWindow::DrawMatrix(), TownAuthorityWindow::DrawRatings(), DrawSliderWidget(), DrawString(), TimetableWindow::DrawSummaryPanel(), StoryBookWindow::EnsureStoryPageElementLayout(), TownViewWindow::GetDesiredInfoHeight(), GetEngineListHeight(), StoryBookWindow::GetHeadHeight(), SmallMapWindow::GetLegendHeight(), SmallMapWindow::GetPositionOnLegend(), VehicleDetailsWindow::GetRoadVehDetailsHeight(), GetTotalCategoriesHeight(), GetVehicleListHeight(), LocalGetWindowPlacement(), ViewportSign::MarkDirty(), NetworkReInitChatBoxSize(), IConsoleWindow::OnInit(), BuildIndustryWindow::OnInit(), IndustryViewWindow::OnInit(), PaymentRatesGraphWindow::OnInit(), IndustryCargoesWindow::OnInit(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), TextfileWindow::ReflowContent(), NWidgetResizeBase::SetMinimalSize(), NWidgetResizeBase::SetMinimalTextLines(), NWidgetBackground::SetupSmallestSize(), and ViewportAddString().
| bool HasAntialiasedFonts | ( | ) |
Should any of the active fonts be anti-aliased?
Definition at line 240 of file fontcache.cpp.
References FS_BEGIN.
| void InitFontCache | ( | bool | monospace | ) |
(Re)initialize the font cache related things, i.e.
load the non-sprite fonts.
| monospace | Whether to initialise the monospace or regular fonts. |
Definition at line 197 of file fontcache.cpp.
References FS_BEGIN.
Referenced by MissingGlyphSearcher::FindMissingGlyphs(), and SetFallbackFont().
| void LoadFreeTypeFont | ( | FontSize | fs | ) |
Loads the freetype font.
First type to load the fontname as if it were a path. If that fails, try to resolve the filename of the font using fontconfig, where the format is 'font family name' or 'font family name, font style'.
| fs | The font size to load. |
Definition at line 161 of file freetypefontcache.cpp.
References GetFontCacheSubSetting(), and settings.
| void LoadFreeTypeFont | ( | FontSize | fs, |
| const std::string & | file_name, | ||
| uint | size | ||
| ) |
Load a TrueType font from a file.
| fs | The font size to load. |
| file_name | Path to the font file. |
| size | Requested font size. |
Definition at line 211 of file freetypefontcache.cpp.
| void UninitFontCache | ( | ) |
Free everything allocated w.r.t.
fonts.
Definition at line 224 of file fontcache.cpp.
References FS_BEGIN.
| void UninitFreeType | ( | ) |