Skip to content

Commit e2a49e0

Browse files
committed
Skip CGContextSelectFont if font lookup fails
1 parent 01ce972 commit e2a49e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/_macosx.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,9 @@ static CGRect _find_enclosing_rect(CGPoint points[3])
25722572
PyErr_SetString(PyExc_ValueError, "Could not load font");
25732573
}
25742574
#ifndef COMPILING_FOR_10_5
2575-
CGContextSelectFont(cr, name, size, kCGEncodingMacRoman);
2575+
else {
2576+
CGContextSelectFont(cr, name, size, kCGEncodingMacRoman);
2577+
}
25762578
#endif
25772579
#if PY3K
25782580
Py_XDECREF(ascii);

0 commit comments

Comments
 (0)