Commit Graph

60 Commits

Author SHA1 Message Date
Michael Lutz
6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 2024-01-14 22:50:56 +01:00
Rubidium
3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
Peter Nelson
46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 2023-11-05 19:24:59 +00:00
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
2023-07-19 19:30:14 +02:00
Jonathan G Rennison
a6b625eea3
Fix #10993: Crash log when font caches not initialised (#11024)
See also: #10836
2023-06-17 17:56:27 +01:00
Peter Nelson
9976293c1e Codechange: Return fontcache font name as std::string. 2023-05-27 20:40:25 +01:00
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.
2023-05-18 12:18:30 +01:00
glx22
04ee86d3ac Add: 'font' console command to configure fonts 2022-12-23 23:23:03 +01:00
glx22
af3df959c2 Codechange: reduce code duplication 2022-12-23 23:23:03 +01:00
Peter Nelson
daaa058493 Change: Vertically centre sprite font relative to TrueType font. 2022-12-18 11:46:01 -05:00
Peter Nelson
b00e18fe9f Cleanup: Remove unused GetUnicodeGlyph() 2022-09-25 18:34:24 +01:00
Peter Nelson
2cdd8b7429 Change: Separate fontcache implementations. 2022-09-25 18:34:24 +01:00
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.
2022-09-25 18:34:24 +01:00
rubidium42
77330d09fd Codechange: move font settings to std::string 2021-05-13 23:13:17 +02:00
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.
2021-05-01 10:41:39 +01:00
Michael Lutz
46e13313e4 Fix #8731: Always use a 32bpp blitter if font anti-aliasing is enabled. 2021-02-23 22:15:03 +01:00
Michael Lutz
c6af8f16f6 Codechange: [Win32] Move Win32-specific font code to a seperate file. 2021-02-13 20:09:14 +01:00
Michael Lutz
5ad1640984 Codechange: Make OS font handle of the FontCache read-only. 2021-02-13 20:09:14 +01:00
Michael Lutz
2b0200d429 Codechange: OS-specific data for font search is not used outside of searching. 2021-02-13 20:09:14 +01:00
S. D. Cloudt
13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Michael Lutz
d2ed426077 Codechange: [Win32] Pass a native GDI font description around when we have one, instead of repeatedly guessing the font. 2019-05-14 11:21:36 +01:00
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.
2019-05-14 11:21:36 +01:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
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.
2018-12-08 20:13:27 +01:00
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.
2018-06-06 21:37:09 +02:00
peter1138
1088ad48fc (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 2014-10-12 20:43:25 +00:00
rubidium
00c05e79b1 (svn r26170) -Feature-ish: add the currently used fonts to the crash log 2013-12-22 17:46:27 +00:00
frosch
dcec8b9abd (svn r25860) -Fix [FS#5737] (r25570): When clearing font cache, also clear layout cache. (adf88) 2013-10-13 13:28:06 +00:00
rubidium
0c14a586bd (svn r25493) -Codechange: support for the safer variant of ICU's getFontTable 2013-06-27 21:21:47 +00:00
rubidium
7b10e39bf1 (svn r25469) -Add: method for getting the font tables from freetype fonts 2013-06-25 20:39:58 +00:00
rubidium
43a37f7f28 (svn r25463) -Codechange: export more size related information from the fonts 2013-06-25 20:21:21 +00:00
rubidium
092c33be3f (svn r25462) -Codechange: make a better distinction between characters and glyphs 2013-06-25 20:20:15 +00:00
rubidium
8c5a7cf0ab (svn r25445) -Codechange: simplify the font loading 2013-06-23 15:37:18 +00:00
rubidium
d724088a1c (svn r25442) -Codechange: move height and ascender information into the FontCache instances 2013-06-23 15:32:09 +00:00
rubidium
e1a2a8275b (svn r25438) -Codechange: introduce classes for the FontCache 2013-06-23 15:24:36 +00:00
rubidium
94a5fe6b92 (svn r25437) -Codechange: rework the FreeTypeSettings structure to make it better grouped 2013-06-23 15:23:22 +00:00
rubidium
13c450a66b (svn r25436) -Codechange: split the font detection code out of the font caching code 2013-06-23 15:20:23 +00:00
rubidium
974a08bf60 (svn r23992) -Fix: compilation without freetype 2012-02-25 22:18:53 +00:00
frosch
df54f25efe (svn r23987) -Fix (r23000): Also reset the font glyph cache when switching blitters. 2012-02-25 17:20:02 +00:00
rubidium
9512838a5e (svn r23275) -Codechange: allow loading of the monospace (freetype) font at another moment than the other fonts 2011-11-20 11:59:36 +00:00
rubidium
dfefcab47d (svn r23274) -Add: internal support for a monospaced sprite font 2011-11-20 11:56:51 +00:00
rubidium
542c61397c (svn r23271) -Codechange: don't repeatedly initialise and free the freetype library 2011-11-20 08:08:13 +00:00
rubidium
447884fddb (svn r23265) -Codechange: replace the setfallbackfont callback function with a class to call back 2011-11-19 18:43:00 +00:00
peter1138
8a41530585 (svn r23009) -Change: Improve appearance of antialiased text with shadow. 2011-10-07 07:48:59 +00:00
glx
d9173858a2 (svn r21298) -Fix [FS#4261]: fonts set in openttd.cfg were not properly checked for missing glyphs on language change 2010-11-23 17:59:50 +00:00
alberth
f0ebe530ad (svn r20296) -Fix: Fallback font selection due to missing glyphs did not work as intended. 2010-08-02 12:10:48 +00:00
rubidium
82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
michi_cc
94003b455c (svn r17794) -Feature: [OSX] Implement automatic fallback font selection for OSX. 2009-10-17 22:36:43 +00:00
rubidium
54806e7437 (svn r17696) -Fix (r17693): compile failure when compiling without freetype 2009-10-04 18:13:56 +00:00
rubidium
7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00