Merge branch 'master' into jgrpp

# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	src/aircraft_cmd.cpp
#	src/airport_gui.cpp
#	src/articulated_vehicles.cpp
#	src/build_vehicle_gui.cpp
#	src/company_gui.cpp
#	src/genworld_gui.cpp
#	src/gfx_layout.cpp
#	src/misc_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_config.h
#	src/newgrf_engine.cpp
#	src/news_gui.cpp
#	src/order_gui.cpp
#	src/roadveh_cmd.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/ship_cmd.cpp
#	src/statusbar_gui.cpp
#	src/table/settings/network_private_settings.ini
#	src/table/settings/network_settings.ini
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/vehicle_gui.cpp
This commit is contained in:
Jonathan G Rennison
2023-05-31 23:11:44 +01:00
163 changed files with 2483 additions and 2703 deletions

View File

@@ -21,13 +21,6 @@
#include <type_traits>
#include <vector>
#ifdef WITH_ICU_LX
#include "layout/ParagraphLayout.h"
#define ICU_FONTINSTANCE : public icu::LEFontInstance
#else /* WITH_ICU_LX */
#define ICU_FONTINSTANCE
#endif /* WITH_ICU_LX */
/**
* Text drawing parameters, which can change while drawing a line, but are kept between multiple parts
* of the same text, e.g. on line breaks.
@@ -83,30 +76,12 @@ struct FontState {
/**
* Container with information about a font.
*/
class Font ICU_FONTINSTANCE {
class Font {
public:
FontCache *fc; ///< The font we are using.
TextColour colour; ///< The colour this font has to be.
Font(FontSize size, TextColour colour);
#ifdef WITH_ICU_LX
/* Implementation details of LEFontInstance */
le_int32 getUnitsPerEM() const;
le_int32 getAscent() const;
le_int32 getDescent() const;
le_int32 getLeading() const;
float getXPixelsPerEm() const;
float getYPixelsPerEm() const;
float getScaleFactorX() const;
float getScaleFactorY() const;
const void *getFontTable(LETag tableTag) const;
const void *getFontTable(LETag tableTag, size_t &length) const;
LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
#endif /* WITH_ICU_LX */
};
/** Mapping from index to font. */
@@ -183,7 +158,7 @@ public:
/** Item in the linecache */
struct LineCacheItem {
/* Stuff that cannot be freed until the ParagraphLayout is freed */
void *buffer; ///< Accessed by both ICU's and our ParagraphLayout::nextLine.
void *buffer; ///< Accessed by our ParagraphLayout::nextLine.
FontMap runs; ///< Accessed by our ParagraphLayout::nextLine.
FontState state_after; ///< Font state after the line.