OpenTTD Source 20241224-master-gee860a5c8e
|
Handling of laying out with ICU / Harfbuzz. More...
#include "stdafx.h"
#include "gfx_layout_icu.h"
#include "debug.h"
#include "strings_func.h"
#include "language.h"
#include "table/control_codes.h"
#include "zoom_func.h"
#include "3rdparty/icu/scriptrun.h"
#include <unicode/ubidi.h>
#include <unicode/brkiter.h>
#include <hb.h>
#include <hb-ft.h>
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
class | ICURun |
Helper class to store the information of all the runs of a paragraph in. More... | |
class | ICUParagraphLayout |
Wrapper for doing layouts with ICU. More... | |
class | ICUParagraphLayout::ICUVisualRun |
Visual run contains data about the bit of text with the same font. More... | |
class | ICUParagraphLayout::ICULine |
A single line worth of VisualRuns. More... | |
Functions | |
std::vector< ICURun > | ItemizeBidi (UChar *buff, size_t length) |
Itemize the string into runs per embedding level. | |
std::vector< ICURun > | ItemizeScript (UChar *buff, size_t length, std::vector< ICURun > &runs_current) |
Itemize the string into runs per script, based on the previous created runs. | |
std::vector< ICURun > | ItemizeStyle (std::vector< ICURun > &runs_current, FontMap &font_mapping) |
Itemize the string into runs per style, based on the previous created runs. | |
Variables | |
constexpr float | FONT_SCALE = 64.0 |
HarfBuzz FreeType integration sets the font scaling, which is always in 1/64th of a pixel. | |
Handling of laying out with ICU / Harfbuzz.
Definition in file gfx_layout_icu.cpp.
std::vector< ICURun > ItemizeBidi | ( | UChar * | buff, |
size_t | length | ||
) |
Itemize the string into runs per embedding level.
Later on, based on the levels, we can deduce the order of a subset of runs.
buff | The string to itemize. |
length | The length of the string. |
Definition at line 250 of file gfx_layout_icu.cpp.
References _current_text_dir, Debug, and TD_RTL.
std::vector< ICURun > ItemizeScript | ( | UChar * | buff, |
size_t | length, | ||
std::vector< ICURun > & | runs_current | ||
) |
Itemize the string into runs per script, based on the previous created runs.
Basically, this always returns the same or more runs than given.
buff | The string to itemize. |
length | The length of the string. |
runs_current | The current runs. |
Definition at line 302 of file gfx_layout_icu.cpp.
Itemize the string into runs per style, based on the previous created runs.
Basically, this always returns the same or more runs than given.
runs_current | The current runs. |
font_mapping | The font mapping. |
Definition at line 335 of file gfx_layout_icu.cpp.
|
constexpr |
HarfBuzz FreeType integration sets the font scaling, which is always in 1/64th of a pixel.
Definition at line 30 of file gfx_layout_icu.cpp.
Referenced by ICURun::Shape().