Ticket #13787: patch-ManOpen_ManDocument.m.diff

File patch-ManOpen_ManDocument.m.diff, 1.7 KB (added by blb@…, 15 years ago)

files/patch-ManOpen_ManDocument.m.diff

  • ManOpen/ManDocument.m

    old new  
    325325#ifdef MACOS_X
    326326    /* The new ATS typesetter in Jaguar causes some weirdnesses... but is fixed in later versions. */
    327327    if (IsPantherOrEarlier())
    328         [[textView layoutManager] setTypesetter:[NSSimpleHorizontalTypesetter sharedInstance]];
     328        [[textView layoutManager] setTypesetter:[NSTypesetter sharedSystemTypesetter]];
    329329#endif
    330330
    331331    if (sizeString != nil)
     
    631631    NSFont *font = ManFont();
    632632    int currPage = [[NSPrintOperation currentOperation] currentPage];
    633633    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;
    635637    NSPoint point = NSMakePoint(size.width/2 - strWidth/2, 20.0);
    636638
    637639#ifdef MACOS_X
     
    641643    CGContextSetTextMatrix(context, CGAffineTransformIdentity);
    642644    CGContextSetTextDrawingMode(context, kCGTextFill);  //needed?
    643645    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]);
    646648    CGContextRestoreGState(context);
    647649#else
    648650    PSgsave();