Changeset 901
- Timestamp:
- 05/24/08 16:53:25 (3 months ago)
- Files:
-
- trunk/Subtitles/SubATSUIRenderer.m (modified) (5 diffs)
- trunk/Subtitles/SubImport.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Subtitles/SubATSUIRenderer.m
r874 r901 288 288 289 289 static NSMutableDictionary *fontIDCache = nil; 290 static ATSUFontID fontCount=-1, *fontIDs = NULL; 290 291 291 292 static void CleanupFontIDCache() __attribute__((destructor)); … … 294 295 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 295 296 if (fontIDCache) [fontIDCache release]; 297 if (fontIDs) free(fontIDs); 296 298 fontIDCache = nil; 299 fontIDs = NULL; 297 300 [pool release]; 298 301 } … … 316 319 if (font == kATSUInvalidFontID) font = ATSFontFindFromName((CFStringRef)name, kATSOptionFlagsDefault); // for bugs in ATS under 10.4 317 320 if (font == kATSUInvalidFontID) { // try a case-insensitive search 318 ItemCount fontCount; 319 ATSUFontCount(&fontCount); 320 321 ATSUFontID fontIDs[fontCount]; 322 ItemCount arraySize = fontCount; 323 ATSUGetFontIDs(fontIDs, arraySize, &fontCount); 324 325 // I do not want to call ATSUFindFontName twice 326 // so I make the buffer large enough. 321 if (fontCount == -1) { 322 ATSUFontCount(&fontCount); 323 fontIDs = malloc(sizeof(ATSUFontID[fontCount])); 324 ATSUGetFontIDs(fontIDs, fontCount, &fontCount); 325 } 326 327 327 ByteCount len; 328 328 ItemCount x, index; … … 368 368 ATSUSetAttributes(style, sizeof(tags) / sizeof(ATSUAttributeTag), tags, sizes, vals); 369 369 370 if (s->tracking ) {370 if (s->tracking > 0) { // bug in VSFilter: negative tracking in style lines is ignored 371 371 Fixed tracking = FloatToFixed(s->tracking); 372 372 … … 495 495 case tag_fscx: 496 496 fv(); 497 fval /= 100.; 498 mat = CGAffineTransformMakeScale(fval, spanEx->scaleY); 499 spanEx->scaleX = fval; 497 spanEx->scaleX = fval / 100.; 498 mat = CGAffineTransformMakeScale(spanEx->scaleX, spanEx->scaleY); 500 499 SetATSUStyleOther(spanEx->style, kATSUFontMatrixTag, sizeof(CGAffineTransform), &mat); 501 500 break; 502 501 case tag_fscy: 503 502 fv(); 504 fval /= 100.; 505 mat = CGAffineTransformMakeScale(spanEx->scaleX, fval); 506 spanEx->scaleY = fval; 503 spanEx->scaleY = fval / 100.; 504 mat = CGAffineTransformMakeScale(spanEx->scaleX, spanEx->scaleY); 507 505 SetATSUStyleOther(spanEx->style, kATSUFontMatrixTag, sizeof(CGAffineTransform), &mat); 508 506 break; trunk/Subtitles/SubImport.mm
r873 r901 99 99 (*imgDesc)->depth = 32; 100 100 (*imgDesc)->clutID = -1; 101 102 if (!trackWidth || !trackHeight) {trackWidth = IntToFixed(640); trackHeight = IntToFixed(480);} 101 103 102 104 if (imageExtension) AddImageDescriptionExtension(imgDesc, imageExtension, subType);
