Commit Graph

118 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison d7b75614bb Merge branch 'master' into jgrpp
# Conflicts:
#	media/baseset/CMakeLists.txt
#	src/build_vehicle_gui.cpp
#	src/console.cpp
#	src/debug.cpp
#	src/fontcache/freetypefontcache.cpp
#	src/network/network.cpp
#	src/openttd.cpp
#	src/os/macosx/font_osx.cpp
#	src/os/windows/font_win32.cpp
#	src/settings_gui.cpp
#	src/video/sdl2_v.cpp
#	src/widgets/settings_widget.h
#	src/window_gui.h
4 months ago
Michael Lutz e1f5be6244 Add: GUI options to select sprite font and AA mode for all fonts. 4 months ago
Michael Lutz 6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 4 months ago
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
4 months ago
Jonathan G Rennison 55d78a23be Merge branch 'master' into jgrpp
# Conflicts:
#	src/3rdparty/squirrel/include/squirrel.h
#	src/blitter/32bpp_sse_func.hpp
#	src/bridge_map.h
#	src/clear_map.h
#	src/company_manager_face.h
#	src/console_func.h
#	src/core/bitmath_func.hpp
#	src/core/endian_func.hpp
#	src/core/random_func.hpp
#	src/depot_map.h
#	src/elrail_func.h
#	src/fontcache.h
#	src/industry_map.h
#	src/map_func.h
#	src/newgrf_spritegroup.h
#	src/object_map.h
#	src/rail.h
#	src/rail_map.h
#	src/road_func.h
#	src/road_map.h
#	src/saveload/saveload.h
#	src/saveload/saveload_error.hpp
#	src/settings_gui.cpp
#	src/sl/oldloader.h
#	src/sprite.h
#	src/spritecache.h
#	src/station_func.h
#	src/station_map.h
#	src/story_base.h
#	src/strings_func.h
#	src/tile_cmd.h
#	src/tile_map.h
#	src/tile_type.h
#	src/town.h
#	src/town_map.h
#	src/tree_map.h
#	src/tunnel_map.h
#	src/tunnelbridge_map.h
#	src/vehicle_func.h
#	src/viewport_func.h
#	src/void_map.h
#	src/water.h
#	src/water_map.h
#	src/widget_type.h
4 months ago
Rubidium 3a676a5af0 Codechange: replace static inline with static for non-class functions 4 months ago
Jonathan G Rennison 34668bff87 Test: Add upstream tests 5 months ago
Peter Nelson 46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 6 months ago
Rubidium 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
10 months ago
Jonathan G Rennison 1e5bc2c12b Merge branch 'master' into jgrpp 11 months ago
Jonathan G Rennison a6b625eea3
Fix #10993: Crash log when font caches not initialised (#11024)
See also: #10836
11 months ago
Peter Nelson b505805bfe Fix: Don't rely on static initialization to set up sprite font caches.
The order of static initialization is undefined, so this can cause initalization
before relevant caches are initializations.

(cherry picked from commit f454ec8d63)
12 months ago
Peter Nelson 9976293c1e Codechange: Return fontcache font name as std::string. 12 months ago
Peter Nelson f454ec8d63 Fix: Don't rely on static initialization to set up sprite font caches.
The order of static initialization is undefined, so this can cause initalization
before relevant caches are initializations.
1 year ago
Jonathan G Rennison 58d841486e Merge branch 'master' into jgrpp
# Conflicts:
#	src/os/windows/font_win32.cpp
#	src/script/api/script_object.hpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/viewport.cpp
#	src/viewport_func.h
1 year ago
glx22 04ee86d3ac Add: 'font' console command to configure fonts 1 year ago
glx22 af3df959c2 Codechange: reduce code duplication 1 year ago
Jonathan G Rennison 9e33153df9 Merge branch 'master' into jgrpp
# Conflicts:
#	src/os/macosx/string_osx.cpp
1 year ago
Peter Nelson daaa058493 Change: Vertically centre sprite font relative to TrueType font. 1 year ago
Jonathan G Rennison 23b974fb39 Merge branch 'master' into jgrpp
# Conflicts:
#	src/fontcache.cpp
#	src/openttd.cpp
#	src/os/macosx/font_osx.cpp
#	src/os/unix/font_unix.cpp
#	src/os/windows/font_win32.cpp
#	src/strings.cpp
2 years ago
Peter Nelson b00e18fe9f Cleanup: Remove unused GetUnicodeGlyph() 2 years ago
Peter Nelson 2cdd8b7429 Change: Separate fontcache implementations. 2 years ago
Peter Nelson f6ad8e1c9c Change: Rename some freetype things to fontcache.
The font cache supports more than just FreeType as a font provider, but still used freetype in some naming.

This now uses more suitable terms.
2 years ago
Jonathan G Rennison fd605e3cf3 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/company_cmd.cpp
#	src/console_cmds.cpp
#	src/crashlog.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/indonesian.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/swedish.txt
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/mcf.cpp
#	src/network/core/tcp.cpp
#	src/network/core/tcp.h
#	src/network/core/tcp_game.h
#	src/network/core/udp.h
#	src/network/network.cpp
#	src/network/network_admin.cpp
#	src/network/network_admin.h
#	src/network/network_chat_gui.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_func.h
#	src/network/network_internal.h
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf.cpp
#	src/newgrf_station.cpp
#	src/order_gui.cpp
#	src/rail_cmd.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/table/currency_settings.ini
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
#	src/terraform_cmd.cpp
#	src/timetable_gui.cpp
#	src/train_cmd.cpp
#	src/tree_cmd.cpp
#	src/water_cmd.cpp
3 years ago
rubidium42 77330d09fd Codechange: move font settings to std::string 3 years ago
Peter Nelson 78ccee01d4 Codechange: Scale sprite font height once on init instead of every call to GetHeight().
Scaling is not expensive, but it does not change either, and this avoids the need for a virtual method call. This cascades back to all GetCharacterHeight(FS_xxx) and FONT_HEIGHT_xxx calls.

(cherry picked from commit 9c6c0a0966)
3 years ago
Peter Nelson 9c6c0a0966 Codechange: Scale sprite font height once on init instead of every call to GetHeight().
Scaling is not expensive, but it does not change either, and this avoids the need for a virtual method call. This cascades back to all GetCharacterHeight(FS_xxx) and FONT_HEIGHT_xxx calls.
3 years ago
Jonathan G Rennison f4e29071be Merge tag '1.11.0-beta2' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release.yml
#	CMakeLists.txt
#	src/blitter/32bpp_optimized.cpp
#	src/debug.cpp
#	src/gfx.cpp
#	src/gfx_func.h
#	src/lang/czech.txt
#	src/lang/english.txt
#	src/lang/italian.txt
#	src/lang/swedish.txt
#	src/lang/ukrainian.txt
#	src/network/network_server.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/win32.cpp
#	src/pathfinder/follow_track.hpp
#	src/screenshot.cpp
#	src/settings_type.h
#	src/spritecache.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/video_driver.cpp
#	src/video/video_driver.hpp
#	src/video/win32_v.cpp
3 years ago
Michael Lutz 46e13313e4 Fix #8731: Always use a 32bpp blitter if font anti-aliasing is enabled. 3 years ago
Jonathan G Rennison e95216b59d Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/core/geometry_func.cpp
#	src/date.cpp
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/settings_type.h
#	src/video/allegro_v.cpp
#	src/video/dedicated_v.cpp
#	src/video/null_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
3 years ago
Michael Lutz c6af8f16f6 Codechange: [Win32] Move Win32-specific font code to a seperate file. 3 years ago
Michael Lutz 5ad1640984 Codechange: Make OS font handle of the FontCache read-only. 3 years ago
Michael Lutz 2b0200d429 Codechange: OS-specific data for font search is not used outside of searching. 3 years ago
Jonathan G Rennison cbdd9f84d8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_gui.cpp
#	src/lang/korean.txt
#	src/video/sdl2_v.cpp
#	src/video/sdl2_v.h
#	src/window.cpp
#	src/window_gui.h
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jonathan G Rennison dbc5f1baed Merge branch 'master' into jgrpp-nrt
# Conflicts:
#	src/fontcache.cpp
#	src/game/game_text.cpp
#	src/lang/korean.txt
#	src/os/macosx/crashlog_osx.cpp
#	src/os/windows/crashlog_win.cpp
#	src/station_cmd.cpp
#	src/viewport.cpp
5 years ago
Michael Lutz d2ed426077 Codechange: [Win32] Pass a native GDI font description around when we have one, instead of repeatedly guessing the font. 5 years ago
Michael Lutz 2675762ae9 Add: [Win32] GDI engine for font glyph rendering as a replacement for including FreeType.
Building with FreeType is still possible and will take precedence over the GDI renderer, but
the project files don't include FreeType anymore by default. Combining GDI rendering with ICU
text layout is untested.
5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison 2003a86932 Merge remote-tracking branch 'origin/master' into jgrpp
# Conflicts:
#	src/string.cpp
6 years ago
Michael Lutz 32ce1ce347 Add: [OSX] Text layout using the native CoreText API.
By default, the native API will be used instead of ICU, but if ICU is
forced in using configure, it will take precedence.
6 years ago
Jonathan G Rennison b48a6ef368 Revert "Revert "Add: [Win32] Uniscribe configure options for MinGW targets.""
This reverts commit ca4a4869a2.
6 years ago
Jonathan G Rennison ca4a4869a2 Revert "Add: [Win32] Uniscribe configure options for MinGW targets."
Revert "Change: [Win32] Use Uniscribe instead of ICU for text caret handling."
Revert "Change: [Win32/MSVC] Make the Uniscribe text layouter the windows default and remove usage of the deprecated ICU layout libs."
Revert "Add: [Win32] Text layout using the native Windows Uniscribe library."
Revert "Codechange: Move ParagraphLayouter-specific functions into factory classes instead of relying on overloads."
Revert "Add: [Win32] Native natural sort implementation."

This reverts commit cd966f3810.
This reverts commit eec3f40931.
This reverts commit 33829dc6ab.
This reverts commit 768a31bfe3.
This reverts commit a4278c302b.
This reverts commit f4394debdc.

This is to fix various problems and crashes with text rendering
and font handling on Windows.

See #58.
6 years ago
Jonathan G Rennison 8e9d68048a Merge branch 'master' into jgrpp
# Conflicts:
#	src/string.cpp
6 years ago
Michael Lutz 768a31bfe3 Add: [Win32] Text layout using the native Windows Uniscribe library.
Uniscribe is sometimes producing different results compared to ICU, especially
when RTL and LTR content is mixed. Comparing the results to other programs
(like editors or web browsers) leads me to believe that the result are at least
not worse than ICU and possibly better.
6 years ago
Jonathan G Rennison 30d8cb2d4c Fix font height cache when changing GUI scaling. 8 years ago
Jonathan G Rennison 5aad0b51a3 Cache font heights in a static fixed array.
This is to avoid significant per-call overhead to get font heights,
as this is performed very frequently.
8 years ago
peter1138 aa6fdf6f13 (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 10 years ago
peter1138 1088ad48fc (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 10 years ago