Commit Graph

349 Commits (jgrpp)

Author SHA1 Message Date
Michael Lutz 8c24b2b6ce Fix: [OSX] Fonts loaded directly from a file have to be registered with CoreText for proper text layout. 3 years ago
Patric Stout 4bd3d18f34 Add: use our search-paths to find fonts based on relative filenames too
This allows "small_font = ./myfont.ttf", with "myfont.ttf" located
in "~/.openttd".
3 years ago
Patric Stout d15dc9f40f Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.

Co-authored-by: milek7 <me@milek7.pl>
4 years ago
Jonathan G Rennison f8d6e781ba Merge branch 'master' into jgrpp
# Conflicts:
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj.filters
#	src/base_consist.h
#	src/company_base.h
#	src/newgrf_config.cpp
#	src/newgrf_config.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/saveload/station_sl.cpp
#	src/settings.cpp
#	src/signs_base.h
#	src/string.cpp
#	src/string_func.h
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_cmd.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/null_v.cpp
4 years ago
Michael Lutz 808c8198d5 Codechange: Consistently use WChar when passing characters around, and also define it as char32_t. 4 years ago
Michael Lutz f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
4 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 edfd378e93 Merge branch 'master' into jgrpp
# Conflicts:
#	source.list
#	src/blitter/32bpp_anim.cpp
#	src/linkgraph/linkgraphjob.cpp
#	src/order_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_type.h
5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
Jonathan G Rennison 8b8a97c248 Update line height cache in Win32FontCache::SetFontSize 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 eeccfa2570 Add: [Win32] Support for loading fonts from a file for the GDI font renderer. 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
Michael Lutz a8b6e9f23c Codechange: Refactor the Freetype font cache into a generic part that does not depend on Freetype and into one that does.
This makes it easier to add other TrueType font rendering engines.
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 ba34ec7ade Merge branch 'master' into jgrpp
Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Jonathan G Rennison 7ff252c58d Merge branch 'master' into jgrpp
# Conflicts:
#	Makefile.src.in
#	findversion.sh
#	projects/determineversion.vbs
#	src/aircraft_cmd.cpp
#	src/lang/dutch.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/order_cmd.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.cpp
#	src/town_cmd.cpp
#	src/viewport.cpp
#	src/water_map.h
5 years ago
PeterN 195fd0dc60
Fix #7266: Reorder reinitialization of caches when changing font zoom level. (#7273) 5 years ago
PeterN eeae4512ae
Fix #7003: Freetype fonts were scaled by both GUI and Font zoom levels. (#7267) 5 years ago
Greg Carlin 00d28a500d Feature: Add option to adjust font size separately from GUI size. (#7003)
Adds an option in the "Game Options" next to "Interface Size" called "Font Size". Available options are normal, double, and quad.
5 years ago
Jonathan G Rennison 191afd93c1 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/settings.cpp
#	src/station_cmd.cpp
#	src/table/settings.ini
#	src/vehicle_base.h
#	src/widgets/dropdown.cpp
5 years ago
glx 1623cb553b Fix #7032: use the same mode to load and render glyphs 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 4d1bd8e4b4 Merge branch 'master' into jgrpp
# Conflicts:
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/music.cpp
#	src/table/settings.ini
#	src/town_cmd.cpp
#	src/train_cmd.cpp
6 years ago
Jonathan G Rennison b48a6ef368 Revert "Revert "Add: [Win32] Uniscribe configure options for MinGW targets.""
This reverts commit ca4a4869a2.
6 years ago
Michael Lutz ae467ffc8a Fix: Scale default FreeType font size selection by UI zoom level. 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 f34833f111 Merge branch 'improved_breakdowns' into jgrpp
# Conflicts:
#	src/vehiclelist.cpp
7 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch a47fb85cd8 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
Jonathan G Rennison 52dadc9252 Merge branch 'master' into jgrpp 7 years ago
frosch 64c5f00429 (svn r27888) -Fix: Member access coding style (adf88) 7 years ago
frosch f1f07b55f4 (svn r27888) -Fix: Member access coding style (adf88) 7 years ago
peter1138 08fe8459c3 (svn r27859) -Revert (r27858): Committed too much :( 7 years ago
peter1138 5932c84011 (svn r27859) -Revert (r27858): Committed too much :( 7 years ago
peter1138 c973f65acb (svn r27858) -Change [FS#6560]: Add missing game script event for ships arriving at a station. (juanjo) 7 years ago
peter1138 e9e44105eb (svn r27858) -Change [FS#6560]: Add missing game script event for ships arriving at a station. (juanjo) 7 years ago
Jonathan G Rennison ee38db6cde Fix font height cache being incorrect for FreeType fonts. 8 years ago
Jonathan G Rennison 30d8cb2d4c Fix font height cache when changing GUI scaling. 9 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.
9 years ago
frosch aef1cf42e1 (svn r27187) -Fix: Code style. 9 years ago
frosch bed0370ad1 (svn r27187) -Fix: Code style. 9 years ago
frosch 8767a11d60 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 9 years ago
frosch a8080b6256 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 9 years ago
planetmaker 84e2d4dd9e (svn r27079) -Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3) 10 years ago
planetmaker 24fec6da12 (svn r27079) -Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3) 10 years ago
rubidium 0c2f4bdc2b (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
peter1138 d549ed2d6c (svn r27015) -Codechange: Also scale the character spacing for fonts without shadow. 10 years ago
peter1138 2eb38ef9e9 (svn r27015) -Codechange: Also scale the character spacing for fonts without shadow. 10 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
rubidium 660a95e5d2 (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 10 years ago
rubidium 771dcf3b7b (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 10 years ago
rubidium 2be4215f43 (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
fonsinchen d766a72146 (svn r26389) -Fix [FS#5885]: Select a specific font size when freetype fails to select one automatically. 10 years ago
fonsinchen b816e07742 (svn r26389) -Fix [FS#5885]: Select a specific font size when freetype fails to select one automatically. 10 years ago
rubidium 4a911754b5 (svn r26209) -Codechange: remove some template magic and simplify some code 11 years ago
rubidium 2618d960e3 (svn r26209) -Codechange: remove some template magic and simplify some code 11 years ago
rubidium 8860bb5c8d (svn r26170) -Feature-ish: add the currently used fonts to the crash log 11 years ago
rubidium 00c05e79b1 (svn r26170) -Feature-ish: add the currently used fonts to the crash log 11 years ago
frosch 0cf1de904d (svn r25860) -Fix [FS#5737] (r25570): When clearing font cache, also clear layout cache. (adf88) 11 years ago
frosch dcec8b9abd (svn r25860) -Fix [FS#5737] (r25570): When clearing font cache, also clear layout cache. (adf88) 11 years ago
frosch 56bf93b35a (svn r25822) -Fix [FS#5704]: Searching for a suitable font failed, if one of the fonts had no '?' glyph, and no baseset is installed. 11 years ago
frosch b4609fd923 (svn r25822) -Fix [FS#5704]: Searching for a suitable font failed, if one of the fonts had no '?' glyph, and no baseset is installed. 11 years ago
frosch 520a8de3e1 (svn r25569) -Codechange: Cache all Font instances in a static container. 11 years ago
frosch 4824cb7886 (svn r25569) -Codechange: Cache all Font instances in a static container. 11 years ago
rubidium 31c0eda620 (svn r25511) -Fix-ish: add the same printable key assert to the sprite font cache as the freetype font cache 11 years ago
rubidium fac0b83df6 (svn r25511) -Fix-ish: add the same printable key assert to the sprite font cache as the freetype font cache 11 years ago
rubidium d09127996d (svn r25501) -Fix: compilation error on OS X 11 years ago
rubidium 3831e3829d (svn r25501) -Fix: compilation error on OS X 11 years ago
rubidium f2d78be786 (svn r25493) -Codechange: support for the safer variant of ICU's getFontTable 11 years ago
rubidium 0c14a586bd (svn r25493) -Codechange: support for the safer variant of ICU's getFontTable 11 years ago
rubidium 1e7ff472c7 (svn r25469) -Add: method for getting the font tables from freetype fonts 11 years ago
rubidium 7b10e39bf1 (svn r25469) -Add: method for getting the font tables from freetype fonts 11 years ago
rubidium 755bd9901d (svn r25463) -Codechange: export more size related information from the fonts 11 years ago
rubidium 43a37f7f28 (svn r25463) -Codechange: export more size related information from the fonts 11 years ago
rubidium 71f6eab843 (svn r25462) -Codechange: make a better distinction between characters and glyphs 11 years ago
rubidium 092c33be3f (svn r25462) -Codechange: make a better distinction between characters and glyphs 11 years ago
frosch 15993b7d87 (svn r25451) -Fix (r25445): Ini configuration for medium font was overwritten by front configuration of other sizes. 11 years ago
frosch 798f472552 (svn r25451) -Fix (r25445): Ini configuration for medium font was overwritten by front configuration of other sizes. 11 years ago
rubidium e326a4b865 (svn r25446) -Codechange: call sprite fontcache code from freetype font cache in case a sprite must be shown 11 years ago
rubidium 8190d26f9e (svn r25446) -Codechange: call sprite fontcache code from freetype font cache in case a sprite must be shown 11 years ago
rubidium 67dc369a82 (svn r25445) -Codechange: simplify the font loading 11 years ago
rubidium 8c5a7cf0ab (svn r25445) -Codechange: simplify the font loading 11 years ago
rubidium 24db751594 (svn r25444) -Codechange: move sprite font code together with the other sprite font code 11 years ago
rubidium c23eaf0790 (svn r25444) -Codechange: move sprite font code together with the other sprite font code 11 years ago
rubidium e73e0a6a7c (svn r25443) -Codechange: move the glyph to sprite cache into the FreeTypeFontCache instance 11 years ago
rubidium ac4dd5d627 (svn r25443) -Codechange: move the glyph to sprite cache into the FreeTypeFontCache instance 11 years ago
rubidium aa9bf82121 (svn r25442) -Codechange: move height and ascender information into the FontCache instances 11 years ago
rubidium d724088a1c (svn r25442) -Codechange: move height and ascender information into the FontCache instances 11 years ago
rubidium 49e71c3bee (svn r25441) -Codechange: move the freetype font allocation into the FreeTypeFontCache 11 years ago