|
OpenTTD Source 20260304-master-g1baaa74679
|
Functions related to laying out text on Win32. More...
#include "../../stdafx.h"#include "../../debug.h"#include "string_uniscribe.h"#include "../../language.h"#include "../../strings_func.h"#include "../../string_func.h"#include "../../core/utf8.hpp"#include "../../table/control_codes.h"#include "../../zoom_func.h"#include "win32.h"#include <windows.h>#include <usp10.h>#include "../../safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | UniscribeRun |
| Contains all information about a run of characters. More... | |
| class | UniscribeParagraphLayout |
| Wrapper for doing layouts with Uniscribe. More... | |
| class | UniscribeParagraphLayout::UniscribeVisualRun |
| Visual run contains data about the bit of text with the same font. More... | |
| class | UniscribeParagraphLayout::UniscribeLine |
| A single line worth of VisualRuns. More... | |
Functions | |
| static std::vector< SCRIPT_ITEM > | UniscribeItemizeString (UniscribeParagraphLayoutFactory::CharType *buff, int32_t length) |
| Break a string into language formatting ranges. | |
| static bool | UniscribeShapeRun (const UniscribeParagraphLayoutFactory::CharType *buff, UniscribeRun &range) |
| Determine the glyph positions for a run. | |
| void | UniscribeResetScriptCache (FontSize size) |
| static HFONT | HFontFromFont (Font *font) |
| Load the matching native Windows font. | |
Variables | |
| static SCRIPT_CACHE | _script_cache [FS_END] |
| Uniscribe cache for internal font information, cleared when OTTD changes fonts. | |
Functions related to laying out text on Win32.
Definition in file string_uniscribe.cpp.
|
static |
Load the matching native Windows font.
| font | The internal font configuration to load. |
Definition at line 143 of file string_uniscribe.cpp.
References convert_to_fs(), Font::fc, FontCache::GetFontName(), FontCache::GetHeight(), and FontCache::GetOSHandle().
Referenced by UniscribeShapeRun().
|
static |
Break a string into language formatting ranges.
| buff | The string to itemize. |
| length | The length of the string. |
Definition at line 260 of file string_uniscribe.cpp.
References _current_language, _current_text_dir, and TD_RTL.
Referenced by UniscribeParagraphLayoutFactory::GetParagraphLayout(), and UniscribeStringIterator::SetString().
| void UniscribeResetScriptCache | ( | FontSize | size | ) |
Definition at line 130 of file string_uniscribe.cpp.
|
static |
Determine the glyph positions for a run.
| buff | The buffer of characters to shape. | |
| [in,out] | range | The metadata about the run. |
true iff shaping was executed without issues. Definition at line 162 of file string_uniscribe.cpp.
References _script_cache, Font::fc, FontCache::GetGlyphWidth(), FontCache::GetHeight(), FontCache::GetSize(), HFontFromFont(), FontCache::MapCharToGlyph(), and ScaleSpriteTrad().
Referenced by UniscribeParagraphLayoutFactory::GetParagraphLayout(), and UniscribeParagraphLayout::NextLine().
|
static |
Uniscribe cache for internal font information, cleared when OTTD changes fonts.
Definition at line 32 of file string_uniscribe.cpp.
Referenced by UniscribeShapeRun().