diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-12-15 02:53:13 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-12-15 02:53:13 (GMT) |
commit | f4326da1c63ed8d0421a5d315255f2b2c402328e (patch) | |
tree | cdfc6c636aeca07dd6b45ac7cff0b9b530774284 /macosx/tkMacOSXFont.c | |
parent | 47c6cf375321a9f00b0446e3753d6f9d8c357cd8 (diff) | |
download | tk-f4326da1c63ed8d0421a5d315255f2b2c402328e.zip tk-f4326da1c63ed8d0421a5d315255f2b2c402328e.tar.gz tk-f4326da1c63ed8d0421a5d315255f2b2c402328e.tar.bz2 |
Fix for some redraw issues on Tk-Cocoa on OS X 10.11; further refinement of memory management; thanks to Marc Culler for patches
Diffstat (limited to 'macosx/tkMacOSXFont.c')
-rw-r--r-- | macosx/tkMacOSXFont.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index f1e01d2..f329071 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -210,6 +210,7 @@ FindNSFont( nsFont = [fm convertFont:nsFont toSize:size]; nsFont = [fm convertFont:nsFont toHaveTrait:traits]; } + [nsFont retain]; #undef defaultFont return nsFont; } @@ -371,6 +372,7 @@ TkpFontPkgInit( NSFont *nsFont; TkFontAttributes fa; NSMutableCharacterSet *cs; + /* Since we called before TkpInit, we need our own autorelease pool. */ NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* force this for now */ @@ -530,7 +532,7 @@ TkpGetFontFromAttributes( nsFont = FindNSFont(faPtr->family, traits, weight, points, 1); } if (!nsFont) { - Tcl_Panic("Could not deternmine NSFont from TkFontAttributes"); + Tcl_Panic("Could not determine NSFont from TkFontAttributes"); } if (tkFontPtr == NULL) { fontPtr = (MacFont *) ckalloc(sizeof(MacFont)); @@ -675,7 +677,6 @@ TkpGetFontAttrsForChar( { MacFont *fontPtr = (MacFont *) tkfont; NSFont *nsFont = fontPtr->nsFont; - *faPtr = fontPtr->font.fa; if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) { UTF16Char ch = c; |