Fix add application font on macOS
This commit is contained in:
parent
98c85d2923
commit
89cf58ba2b
1 changed files with 2 additions and 3 deletions
|
|
@ -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[] = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue