From c022d5908fa917a4907e54d64aca0bbc56b19755 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Sun, 27 Jul 2025 01:40:12 +0200 Subject: [PATCH] BLF: Increase FreeType Cache Values When we first enabled FreeType font caching we purposely constrained it so that we could see it was working, dropping and loading font faces and sizes as needed. But that was years ago now and it is still running with no more than 4 faces, 8 sizes, and only 400KB of cache. At minimum we run with 3 simultaneous faces (main UI font and two copies of the mono font), so allowing it 4 max seems pretty small. This PR changes the max_faces to 8, sizes to 16, and the cache size to 1MB. Note that these changes will give NO noticable user change, good or bad, under normal circumstances. FreeType will churn a bit less, but the time taken to do these things is very little. Pull Request: https://projects.blender.org/blender/blender/pulls/143240 --- source/blender/blenfont/intern/blf_internal.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenfont/intern/blf_internal.hh b/source/blender/blenfont/intern/blf_internal.hh index a50ecb91d43..b041868ee89 100644 --- a/source/blender/blenfont/intern/blf_internal.hh +++ b/source/blender/blenfont/intern/blf_internal.hh @@ -39,11 +39,11 @@ enum class BLFWrapMode; #define BLF_SUBPIXEL_AA /** Maximum number of opened FT_Face objects managed by cache. 0 is default of 2. */ -#define BLF_CACHE_MAX_FACES 4 +#define BLF_CACHE_MAX_FACES 8 /** Maximum number of opened FT_Size objects managed by cache. 0 is default of 4 */ -#define BLF_CACHE_MAX_SIZES 8 +#define BLF_CACHE_MAX_SIZES 16 /** Maximum number of bytes to use for cached data nodes. 0 is default of 200,000. */ -#define BLF_CACHE_BYTES 400000 +#define BLF_CACHE_BYTES 0x100000 /** * Offset from icon id to Unicode Supplementary Private Use Area-B,