Changeset 1063
- Timestamp:
- 05/30/09 21:58:19 (8 months ago)
- Files:
-
- trunk/Release/Changes.txt (modified) (1 diff)
- trunk/Subtitles/SubParsing.h (modified) (1 diff)
- trunk/Subtitles/SubParsing.m.rl (modified) (4 diffs)
- trunk/Subtitles/ssa2html.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Release/Changes.txt
r1062 r1063 25 25 - Disabled vertical font support again to fix files wrongly using it for Latin text [r1027] 26 26 - Fixed subtitles in MKV wrongly displaying at the end of a video [r1036] 27 - Fixed sub-pixel \pos and the starting position of \move [r1063] 27 28 28 29 1.1.3 trunk/Subtitles/SubParsing.h
r1046 r1063 37 37 NSMutableArray *spans; 38 38 39 int posX, posY;39 float posX, posY; 40 40 UInt8 alignH, alignV, wrapStyle, render_complexity; 41 41 BOOL positioned; trunk/Subtitles/SubParsing.m.rl
r1048 r1063 285 285 unsigned chars_deleted = 0; float floatnum = 0; 286 286 NSString *strval=NULL; 287 unsignedcurX, curY;287 float curX, curY; 288 288 int intnum = 0; 289 289 BOOL reachedEnd = NO, setWrapStyle = NO, setPosition = NO, setAlignForDiv = NO, dropThisSpan = NO; … … 323 323 action setstringval {strval = psend();} 324 324 action nullstring {strval = @"";} 325 action set xypos {curX=curY=-1; sscanf([psend() UTF8String], "(%d,%d)", &curX, &curY);}326 325 action setpos {curX=curY=0; sscanf([psend() UTF8String], "(%f,%f", &curX, &curY);} 326 327 327 action ssaalign { 328 328 if (!setAlignForDiv) { … … 362 362 intnum = ("-"? [0-9]+) >paramset %setintnum; 363 363 flag = [01] >paramset %setintnum; 364 floatnum = ("-"? [0-9]+ ("." [0-9]*)?) >paramset %setfloatnum; 364 floatn = ("-"? ([0-9]+ ("." [0-9]*)?) | ([0-9]* "." [0-9]+)); 365 floatnum = floatn >paramset %setfloatnum; 365 366 string = (([^\\}]+) >paramset %setstringval | "" %nullstring ); 366 367 color = ("H"|"&"){,2} (xdigit+) >paramset %sethexnum "&"?; 367 368 parens = "(" [^)]* ")"; 368 xypos = ("(" "-"? [0-9]+ "," "-"? [0-9]+ ")") >paramset %setxypos; 369 pos = ("(" floatn "," floatn ")") >paramset %setpos; 370 move = ("(" (floatn ","){3,5} floatn ")") >paramset %setpos; 369 371 370 372 cmd = "\\" ( … … 400 402 |"q" intnum %wrapstyle 401 403 |"r" string %stylerevert 402 |"pos" xypos %position 404 |"pos" pos %position 405 |"move" move %position 403 406 |"t" parens 404 407 |"org" parens trunk/Subtitles/ssa2html.m
r1046 r1063 193 193 194 194 if (div->positioned) { 195 [html appendFormat:@"<div style=\"top: % dpx; left: %dpx; position: absolute\">", div->posY, div->posX];195 [html appendFormat:@"<div style=\"top: %fpx; left: %fpx; position: absolute\">", div->posY, div->posX]; 196 196 close_div = 1; 197 197 } … … 227 227 SubRenderDiv *div = [divs objectAtIndex:i]; 228 228 229 if (div->pos X > -1) [abs addObject:div]; else if (div->alignV == kSubAlignmentTop) [top addObject:div]; else [bot insertObject:div atIndex:0];229 if (div->positioned) [abs addObject:div]; else if (div->alignV == kSubAlignmentTop) [top addObject:div]; else [bot insertObject:div atIndex:0]; 230 230 } 231 231
