Changeset 841
- Timestamp:
- 03/31/08 14:37:29 (4 months ago)
- Files:
-
- trunk/Subtitles/SubATSUIRenderer.m (modified) (1 diff)
- trunk/Subtitles/SubContext.m (modified) (1 diff)
- trunk/Subtitles/SubParsing.h (modified) (1 diff)
- trunk/Subtitles/SubParsing.m.rl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Subtitles/SubATSUIRenderer.m
r839 r841 991 991 ATSUTextMeasurement imageWidth, imageHeight; 992 992 993 if (div->pos X != kSubPositionNone|| div->alignV == kSubAlignmentMiddle) GetTypographicRectangleForLayout(layout, breaks, breakCount, FloatToFixed(div->styleLine->outlineRadius), NULL, NULL, &imageHeight, &imageWidth);994 995 if ( div->posX == kSubPositionNone) {993 if (div->positioned || div->alignV == kSubAlignmentMiddle) GetTypographicRectangleForLayout(layout, breaks, breakCount, FloatToFixed(div->styleLine->outlineRadius), NULL, NULL, &imageHeight, &imageWidth); 994 995 if (!div->positioned) { 996 996 penX = FloatToFixed(NSMinX(marginRect)); 997 997 trunk/Subtitles/SubContext.m
r806 r841 141 141 } 142 142 143 static NSString *yes(int i) {return i ? @"yes" : @"no";} 144 145 static NSString *ColorString(SubRGBAColor *c) 146 { 147 return [NSString stringWithFormat:@"{R: %d G: %d B: %d A: %d}", (int)(c->red * 255), 148 (int)(c->green * 255), (int)(c->blue * 255), (int)(c->alpha * 255)]; 149 } 150 151 -(NSString *)description 152 { 153 static const NSString *alignHStr[] = {@"left", @"center", @"right"}; 154 static const NSString *alignVStr[] = {@"bottom", @"middle", @"top"}; 155 static const NSString *bstyle[] = {@"normal", @"box"}; 156 157 return [NSString stringWithFormat:@"" 158 "SubStyle named \"%@\"\n" 159 "-Font: %f pt %@\n" 160 "-Primary color: %@\n" 161 "-Secondary color: %@\n" 162 "-Outline: %f px %@\n" 163 "-Shadow: %f px %@\n" 164 "-Margin: %d px left, %d px right, %d px vertical\n" 165 "-Bold: %@ Italic: %@ Underline: %@ Strikeout: %@\n" 166 "-Alignment: %@ %@\n" 167 "-Border style: %@\n" 168 "-Per-font scale: %f\n", 169 name, size, fontname, ColorString(&primaryColor), 170 ColorString(&secondaryColor), outlineRadius, ColorString(&outlineColor), 171 shadowDist, ColorString(&shadowColor), marginL, marginR, marginV, 172 yes(bold), yes(italic), yes(underline), yes(strikeout), alignHStr[alignH], 173 alignVStr[alignV], bstyle[borderStyle], platformSizeScale]; 174 } 175 143 176 -(void)dealloc 144 177 { trunk/Subtitles/SubParsing.h
r806 r841 27 27 int posX, posY; 28 28 UInt8 alignH, alignV, wrapStyle, render_complexity; 29 BOOL is_shape ;29 BOOL is_shape, positioned; 30 30 31 31 unsigned layer; trunk/Subtitles/SubParsing.m.rl
r838 r841 62 62 spans = nil; 63 63 64 posX = posY = kSubPositionNone;64 posX = posY = 0; 65 65 alignH = kSubAlignmentMiddle; alignV = kSubAlignmentBottom; 66 66 67 is_shape = NO;67 is_shape = positioned = NO; 68 68 render_complexity = 0; 69 69 } … … 92 92 93 93 div->is_shape = NO; 94 div->positioned = positioned; 94 95 div->render_complexity = render_complexity; 95 96 … … 333 334 div->posX = curX; 334 335 div->posY = curY; 336 div->positioned = YES; 335 337 } 336 338
