Page MenuHome

BLF: Enable Filtering of woff and woff2 Files
ClosedPublic

Authored by Harley Acheson (harley) on Jan 12 2022, 8:15 PM.

Details

Summary

Add files with extension ".woff" and ".woff2" to FILE_TYPE_FTFONT
file type. Allows selecting and using these types of font files.


This can only go in after we land update FreeType with optional brotli compression in order to support "Woff2" font files D13448: Freetype 2.11.0 with woff2 support.

Diff Detail

Repository
rB Blender

Event Timeline

Print errors to console if the font file, or the format of it, is not usable.

Updated to the current state of master.

Updated to the current state of master.

Campbell Barton (campbellbarton) added inline comments.
source/blender/blenfont/intern/blf_font.c
1241–1246

This function could instead take a const char **r_err_msg, so the caller can show the error (it could be used in a Python exception for example).

Although this isn't so much related to this patch to expose a new filetype.

This revision is now accepted and ready to land.Feb 8 2022, 5:25 AM

@Campbell Barton (campbellbarton) - This function could instead take a const char **r_err_msg, so the caller can show the error (it could be used in a Python exception for example).

This shouldn't ever fail in any normal circumstance. I only wanted to add these printfs for the weird possibility that Blender is ever compiled against a FreeType that does not have brotli compression library enabled. In that case everything would work fine but ".woff2" fonts wouldn't load.