Commit Graph
47 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 7434052eb6 Codechange: make FontSize a scoped enum 2026-04-12 18:10:34 +02:00
Peter NelsonandPeter Nelson 5aae8e2d64 Codechange: make Subdirectory a scoped enum 2026-04-05 21:46:07 +01:00
Peter NelsonandPeter Nelson 9a0af4387b Codechange: pass required font/os_handle via FontProviderManager::LoadFont()
This allows fonts other than configured to be loaded.
2026-04-03 19:45:46 +01:00
Peter NelsonandPeter Nelson cdfbb113ce Codechange: MissingGlyphSearcher now contains which fontsizes to search for 2026-04-03 19:45:46 +01:00
Peter NelsonandGitHub 36878bfbc8 Codechange: remove duplicate and out-of-date documentation for LoadFont (#15411)
Move comments inline to code where useful.
2026-04-02 12:20:46 +01:00
Rubidiumandrubidium42 6370859c7e Codechange: add missing documentation to destructors 2026-02-24 16:24:53 +01:00
Rubidiumandrubidium42 bcaf3eaec2 Codefix: wrong parameter names and partially missing parameters 2026-02-02 18:18:51 +01:00
Peter NelsonandGitHub f1e831233a Codefix: Mark destructors override. (#14925)
Remove some empty destructors.
2025-12-19 18:14:29 +00:00
Peter NelsonandPeter Nelson b03347f00c Revert: "Change: Support side-by-side fallback FontCaches instead of hierarchical. (#13303)"
This reverts commit 1829f7926d.
2025-12-13 09:09:21 +00:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 1829f7926d Change: Support side-by-side fallback FontCaches instead of hierarchical. (#13303)
The text layouter system can now support using different fonts for different glyphs, including mixing scalable and sprite glyphs.
2025-12-06 10:47:12 +00:00
Peter NelsonandGitHub 8e055156e3 Codefix: Make sure safeguards.h is the last included non-table header. (#14687) 2025-10-11 10:22:50 +01:00
Rubidiumandrubidium42 aa7eb089c6 Codechange: make all Providers fully const (Font/Screenshot/Sound) 2025-09-29 23:39:13 +03:00
Peter NelsonandPeter Nelson e1a50abcbb Codechange: Move fallback font detection to FontCacheFactory.
Provides a standard interface instead of relying on defines.
2025-08-07 19:38:00 +01:00
Peter NelsonandPeter Nelson 140f2b291a Codechange: Use ProviderManager interface to register FontCache factories.
This removes use of #ifdefs to select the appropriate loader, and also replaces FontCache self-registration.
2025-08-07 19:38:00 +01:00
froschandfrosch 8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
froschandfrosch bb767608de Codechange: Pass SpriteType as direct parameter to SpriteEncoder::Encoder. 2025-05-03 18:43:20 +02:00
Rubidiumandrubidium42 708e6a512d Codechange: replace char* with C++ style strings 2025-04-30 12:05:04 +02:00
froschandfrosch e89be12ebb Codechange: Rename _library to _ft_library. 2025-04-11 22:11:28 +02:00
Peter NelsonandGitHub ba20ea5d18 Codechange: Use EnumBitSet for SpriteComponent. (#13509) 2025-02-09 18:37:01 +00:00
Peter NelsonandGitHub 209b0320d5 Fix #12735: Default fonts should use default font size as-is. (#12814)
Minimum readable font size should only apply to fallback and configured fonts.
2024-06-26 12:45:39 +01:00
Peter NelsonandPeter Nelson 48539992e8 Codechange: Use std::unordered_map for storing TrueTypeFontCache's GlyphEntry. 2024-05-30 20:16:28 +01:00
Peter NelsonandPeter Nelson 7b717fcccb Codechange: Replace AllocatorProc with SpriteAllocator class.
This allows for state to be passed to or maintained by the allocator.
2024-05-30 20:16:28 +01:00
Peter NelsonandGitHub 3c42f701d7 Fix: Allow changing size of default OpenTTD font. (#12641)
* Fix: Allow changing size of default OpenTTD font.

Size configuration for default font was ignored as a different code path to load the font was followed.

Resolved by removing this additional path and conditionally selecting the default font.
2024-05-26 15:59:25 +01:00
Peter NelsonandGitHub 980dcaac6e Cleanup: Remove GetFontTable from FontCache. (#12677)
This interface is no longer used, so does not need to be implemented.

Removes manual memory management with malloc/free.
2024-05-14 21:13:26 +01:00
Peter NelsonandGitHub 77a7113ba6 Cleanup: Remove unused parameters from FreeTypeFontCache::SetFontSize. (#12663) 2024-05-12 08:39:40 +01:00
Peter NelsonandGitHub d78f39a9df Cleanup: Remove GetUnitsPerEM and units_per_em. (#12656)
GetUnitsPerEM is never called.
2024-05-11 14:50:34 +01:00
Peter NelsonandPeter Nelson 3c94e81665 Codechange: Use ZOOM_LVL_MIN to refer to first zoom level.
Many uses of ZOOM_LVL_NORMAL actually just want the first zoom level slot, so use ZOOM_LVL_MIN to make this clearer.
2024-04-04 22:27:03 +01:00
Michael Lutz 36cf6b1d13 Feature: Scalable OpenTTD TrueType font made by Zephyris.
This uses the normal variant for the small font, not the all-caps version.
2024-01-14 22:50:56 +01:00
Michael Lutz 6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 2024-01-14 22:50:56 +01:00
Peter NelsonandGitHub b85ecf9ac2 Codechange: Replace pointer to Sprite array with reference to SpriteCollection. (#11580)
Add `SpriteLoader::SpriteCollection` type which is an array of `SpriteLoad::Sprite`.

This removes the ambiguity of what `SpriteLoader::Sprite *` is pointing to,
and cleans up mismatches using both dereference -> and array access [] for the
same object.
2023-12-20 20:38:21 +00:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidiumandrubidium42 eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
PeterNandGitHub 8465559488 Codechange: Pass face index as font os_handle for FreeType fonts. (#11073)
This allows fallback font detection to test the specific face within the
font rather instead of only the first.
2023-06-27 12:30:46 +01:00
PeterNandGitHub 7a0b6b7ddf Codechange: Remove Freetype bits on Win32/OSX. (#10960)
These platforms have their own specific font rendering.
2023-06-06 19:43:27 +01:00
Peter NelsonandPeterN bae1897826 Change: Include font style in font name for Freetype. 2023-05-27 20:40:25 +01:00
Peter NelsonandPeterN 9976293c1e Codechange: Return fontcache font name as std::string. 2023-05-27 20:40:25 +01:00
Patric StoutandPatric Stout 81d4fa6999 Feature: drop ICU-lx in favour of directly interfacing with harfbuzz
This means we have RTL support again with ICU 58+. It makes use of:
- ICU for bidi-itemization
- ICU for script-itemization
- OpenTTD for style-itemization
- harfbuzz for shaping
2023-05-01 22:17:56 +02:00
Rubidiumandrubidium42 f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 2023-04-25 17:55:09 +02:00
Rubidiumandrubidium42 f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 2023-04-24 17:51:54 +02:00
PeterNandGitHub e97bf271dc Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
Patric StoutandGitHub 1fb101eabb Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2023-01-02 20:30:02 +00:00
glx22andLoïc Guilloux af3df959c2 Codechange: reduce code duplication 2022-12-23 23:23:03 +01:00
Peter NelsonandTyler Trahan 8599041ce4 Fix: GetDefaultFontHeight() is static, don't use -> 2022-12-18 11:46:01 -05:00
Peter NelsonandPeterN 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 062ea68422 Change: Scale position of font shadow. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 2cdd8b7429 Change: Separate fontcache implementations. 2022-09-25 18:34:24 +01:00