Commit Graph

162 Commits (f313a539a54efe09850bcab0680d281e3cc54444)

Author SHA1 Message Date
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
Peter Nelson ce55cd0ce7 Cleanup: Use GetDefaultFontHeight() call instead of direct access.
This makes this part of font size setup in FreeTypeFontCache consist with OSX and Windows variants.
3 years ago
Michael Lutz 46e13313e4 Fix #8731: Always use a 32bpp blitter if font anti-aliasing is enabled. 3 years ago
Michael Lutz 6776229047 Codechange: Make the simple Malloc sprite allocator globally usable. 3 years ago
Michael Lutz 70aa3b4011 Codechange: Give sprite encoders a hint which colour components of a sprite are filled with useful information. 3 years ago
Michael Lutz 6755ff63e1 Add: [OSX] Native font rendering without using FreeType. 3 years ago
Michael Lutz 21a2cd7bc3 Codechange: Replace magic numbers by constants. 3 years ago
Michael Lutz 63ed3f3575 Codechange: Move Fontconfig-specific code to a seperate file. 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
SamuXarick a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
Michael Lutz 8c24b2b6ce Fix: [OSX] Fonts loaded directly from a file have to be registered with CoreText for proper text layout. 4 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".
4 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
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
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 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
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 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
glx 1623cb553b Fix #7032: use the same mode to load and render glyphs 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
Michael Lutz ae467ffc8a Fix: Scale default FreeType font size selection by UI zoom level. 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
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch 64c5f00429 (svn r27888) -Fix: Member access coding style (adf88) 7 years ago
peter1138 08fe8459c3 (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
frosch bed0370ad1 (svn r27187) -Fix: Code style. 9 years ago
frosch a8080b6256 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 10 years ago
planetmaker 24fec6da12 (svn r27079) -Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3) 10 years ago
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
peter1138 2eb38ef9e9 (svn r27015) -Codechange: Also scale the character spacing for fonts without shadow. 10 years ago
peter1138 1088ad48fc (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 10 years ago
rubidium 771dcf3b7b (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 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 b816e07742 (svn r26389) -Fix [FS#5885]: Select a specific font size when freetype fails to select one automatically. 10 years ago
rubidium 2618d960e3 (svn r26209) -Codechange: remove some template magic and simplify some code 11 years ago
rubidium 00c05e79b1 (svn r26170) -Feature-ish: add the currently used fonts to the crash log 11 years ago
frosch dcec8b9abd (svn r25860) -Fix [FS#5737] (r25570): When clearing font cache, also clear layout cache. (adf88) 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 4824cb7886 (svn r25569) -Codechange: Cache all Font instances in a static container. 11 years ago