../src/ft2font.cpp:220:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] FT_CHECK(FT_Open_Face, _ft2Library, &open_args, 0, &face); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:46:5: note: expanded from macro 'THROW_FT_ERROR' sprintf(buf, "%#04x", err); \ ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg' #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg))) ^ ../src/ft2font.cpp:220:5: error: 'path' is unavailable: introduced in macOS 10.15 FT_CHECK(FT_Open_Face, _ft2Library, &open_args, 0, &face); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:49:28: note: expanded from macro 'THROW_FT_ERROR' /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__filesystem/path.h:505:3: note: '~path' has been explicitly marked unavailable here ~path() = default; ^ ../src/ft2font.cpp:282:5: error: 'filename' is unavailable: introduced in macOS 10.15 FT_CHECK(FT_Set_Charmap, face, face->charmaps[i]); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:49:43: note: expanded from macro 'THROW_FT_ERROR' + std::filesystem::path(__FILE__).filename().string() \ ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__filesystem/path.h:957:30: note: 'filename' has been explicitly marked unavailable here _LIBCPP_HIDE_FROM_ABI path filename() const { ^ ../src/ft2font.cpp:282:5: error: '~path' is unavailable: introduced in macOS 10.15 FT_CHECK(FT_Set_Charmap, face, face->charmaps[i]); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:49:43: note: expanded from macro 'THROW_FT_ERROR' + std::filesystem::path(__FILE__).filename().string() \ ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__filesystem/path.h:505:3: note: '~path' has been explicitly marked unavailable here ~path() = default; ^ ../src/ft2font.cpp:282:5: error: 'string' is unavailable: introduced in macOS 10.15 FT_CHECK(FT_Set_Charmap, face, face->charmaps[i]); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:49:54: note: expanded from macro 'THROW_FT_ERROR' + std::filesystem::path(__FILE__).filename().string() \ ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__filesystem/path.h:852:39: note: 'string' has been explicitly marked unavailable here _LIBCPP_HIDE_FROM_ABI _VSTD::string string() const { return __pn_; } ^ ../src/ft2font.cpp:287:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] FT_CHECK(FT_Select_Charmap, face, (FT_Encoding)i); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:46:5: note: expanded from macro 'THROW_FT_ERROR' sprintf(buf, "%#04x", err); \ ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.") ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg' #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg))) ^ ../src/ft2font.cpp:287:5: error: 'path' is unavailable: introduced in macOS 10.15 FT_CHECK(FT_Select_Charmap, face, (FT_Encoding)i); ^ ../src/ft2font.h:56:9: note: expanded from macro 'FT_CHECK' THROW_FT_ERROR(#func, error_); \ ^ ../src/ft2font.h:49:28: note: expanded from macro 'THROW_FT_ERROR' + std::filesystem::path(__FILE__).filename().string() \ ^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__filesystem/path.h:442:24: note: 'path' has been explicitly marked unavailable here class _LIBCPP_TYPE_VIS path { ^ fatal error: too many errors emitted, stopping now [-ferror-limit=]
Uh oh!
There was an error while loading.Please reload this page.
Provide a simple macro to call a FreeType function and throw an exception if an error is returned, while also including the source file and line location for the error. For example, trying
FT2Font(open("pyproject.toml", "rb"))
now raises "FT_Open_Face (ft2font.cpp line 220) failed with error 0x02: unknown file format" instead of "Can not load face (unknown file format; error code 0x2)".cf. discussion starting at#30059 (comment).
PR summary
PR checklist