Ticket #13787: patch-ManOpen_ManDocument.m.diff
File patch-ManOpen_ManDocument.m.diff, 1.7 KB (added by blb@…, 16 years ago) |
---|
-
ManOpen/ManDocument.m
old new 325 325 #ifdef MACOS_X 326 326 /* The new ATS typesetter in Jaguar causes some weirdnesses... but is fixed in later versions. */ 327 327 if (IsPantherOrEarlier()) 328 [[textView layoutManager] setTypesetter:[NS SimpleHorizontalTypesetter sharedInstance]];328 [[textView layoutManager] setTypesetter:[NSTypesetter sharedSystemTypesetter]]; 329 329 #endif 330 330 331 331 if (sizeString != nil) … … 631 631 NSFont *font = ManFont(); 632 632 int currPage = [[NSPrintOperation currentOperation] currentPage]; 633 633 NSString *str = [NSString stringWithFormat:@"%d", currPage]; 634 float strWidth = [font widthOfString:str]; 634 // float strWidth = [font widthOfString:str]; 635 NSSize strSize = [str sizeWithAttributes:[NSDictionary dictionaryWithObject:font forKey: NSFontAttributeName]]; 636 float strWidth = strSize.width; 635 637 NSPoint point = NSMakePoint(size.width/2 - strWidth/2, 20.0); 636 638 637 639 #ifdef MACOS_X … … 641 643 CGContextSetTextMatrix(context, CGAffineTransformIdentity); 642 644 CGContextSetTextDrawingMode(context, kCGTextFill); //needed? 643 645 CGContextSetGrayFillColor(context, 0.0, 1.0); 644 CGContextSelectFont(context, [[font fontName] cString], [font pointSize], kCGEncodingMacRoman);645 CGContextShowTextAtPoint(context, point.x, point.y, [str cString], [str cStringLength]);646 CGContextSelectFont(context, [[font fontName] UTF8String], [font pointSize], kCGEncodingMacRoman); 647 CGContextShowTextAtPoint(context, point.x, point.y, [str UTF8String], [str lengthOfBytesUsingEncoding:NSASCIIStringEncoding]); 646 648 CGContextRestoreGState(context); 647 649 #else 648 650 PSgsave();