From 89cf58ba2b497356eb5b078a2700dbb43a245cef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 30 Jun 2024 13:36:22 +0530 Subject: [PATCH] Fix add application font on macOS --- kitty/core_text.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kitty/core_text.m b/kitty/core_text.m index 471432018..81a88c363 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -1108,9 +1108,8 @@ static CTFontRef nerd_font(CGFloat sz) { const unsigned char *path = NULL; Py_ssize_t sz; if (!PyArg_ParseTuple(args, "s#", &path, &sz)) return NULL; RAII_CoreFoundation(CFURLRef, url, CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, path, sz, false)); - RAII_CoreFoundation(CFArrayRef, descriptors, CTFontManagerCreateFontDescriptorsFromURL(url)); - CTFontManagerEnableFontDescriptors(descriptors, true); - Py_RETURN_TRUE; + if (CTFontManagerRegisterFontsForURL(url, kCTFontManagerScopeProcess, NULL)) Py_RETURN_TRUE; + Py_RETURN_FALSE; } static PyMethodDef module_methods[] = {