Commit Graph

23 Commits

Author SHA1 Message Date
c702e05517 Codechange: Replace C-casts for FontConfig with helper functions. (#14349)
Add `ToFcString()` and `FromFcString()` to remove C-style casts and make reinterpret_casts safer and clearer.
2025-06-10 17:11:22 +01:00
Rubidium
708e6a512d Codechange: replace char* with C++ style strings 2025-04-30 12:05:04 +02:00
frosch
e89be12ebb Codechange: Rename _library to _ft_library. 2025-04-11 22:11:28 +02:00
Patric Stout
86841ba1f0 Codechange: no longer add "src" to the include-path (#13511) 2025-02-09 19:43:15 +00:00
Loïc Guilloux
ef826a048a Codechange: [WIN32] Use language isocode for fallback font detection (#13310) 2025-01-21 15:57:09 +01:00
ca52da6c95 Fix: Unable to choose a font containing hyphen. (#12684)
FcNameParse may require some characters be escaped. Instead, pass name as FC_FAMILY.
2024-05-16 00:38:23 +01:00
6a2c37b4ed Fix 09f585b: Crash if font name ends with comma or comma and whitespace on Linux. (#11838) 2024-01-19 08:03:32 +00:00
Rubidium
c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
frosch
b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
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
Rubidium
09f585b772 Codechange: use std::string over stredup+free for splitting font name 2023-06-18 18:32:20 +02:00
f249715db3 Fix #10964: Missing FontConfig format for language. (#10965) 2023-06-06 22:38:11 +00:00
eda3defcb5 Codechange: Pass language for font detection as std::string. (#10964) 2023-06-06 20:55:56 +00:00
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
Patric Stout
cd751a598a Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Basically, we haven't been a good neighbour. Turns out you shouldn't
actually call FcFini when you are done, as some library might still
want to use FontConfig. And they use a shared instance for their
administration.

The idea is that you call FcInit once, and use FcConfigReference
after that to get an instance, you can release. This entry is
ref-counted, and things happen automatically based on that.

At least, I think.
2023-06-03 19:09:02 +00:00
876871157f Fix: Ask FontConfig for the face index when opening fonts. (#10878)
This allows selection of the correct face in truetype fonts containing
multiple faces.
2023-05-26 18:56:13 +00:00
Rubidium
6f2f38b3ed Codechange: fmt (and std::format) do explicitly not support enums out-of-the-box
That it works for the version we have packaged it pure coincidence, as that is
one of the few versions that due to a bug allow it. So add the appropriate
template specialisations to support it out-of-the-box within OpenTTD.
2023-05-22 14:42:18 +02:00
Rubidium
86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Rubidium
f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 2023-04-24 17:51:54 +02:00
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
Rubidium
f904aef176 Cleanup: use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
rubidium42
55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Michael Lutz
63ed3f3575 Codechange: Move Fontconfig-specific code to a seperate file. 2021-02-13 20:09:14 +01:00