]> git.saurik.com Git - winterboard.git/commitdiff
Use letter-spacing to support letterSpacing: draw argument.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 11 Mar 2012 05:16:58 +0000 (05:16 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 11 Mar 2012 05:16:58 +0000 (05:16 +0000)
Library.mm

index 2770df5a1756e166d4e06e61367ea5bc8a5b73d2..fa606a8adbc92af6ba77999a2f9b1dc604b0a429 100644 (file)
@@ -698,7 +698,8 @@ MSInstanceMessageHook6(CGSize, NSString, drawAtPoint,forWidth,withFont,lineBreak
         return MSOldCall(point, width, font, mode, spacing, emoji);
 
     NSString *base(state->base_ ?: @"");
-    [self drawAtPoint:point withStyle:[NSString stringWithFormat:@"%@;%@;%@", [font markupDescription], base, info]];
+    NSString *extra([NSString stringWithFormat:@"letter-spacing: %gpx", spacing]);
+    [self drawAtPoint:point withStyle:[NSString stringWithFormat:@"%@;%@;%@;%@", [font markupDescription], extra, base, info]];
     return CGSizeZero;
 }
 
@@ -737,7 +738,8 @@ MSInstanceMessageHook4(CGSize, NSString, sizeWithFont,forWidth,lineBreakMode,let
         return MSOldCall(font, width, mode, spacing);
 
     NSString *base(state->base_ ?: @"");
-    return [self sizeWithStyle:[NSString stringWithFormat:@"%@;%@;%@", [font markupDescription], base, info] forWidth:width];
+    NSString *extra([NSString stringWithFormat:@"letter-spacing: %gpx", spacing]);
+    return [self sizeWithStyle:[NSString stringWithFormat:@"%@;%@;%@;%@", [font markupDescription], extra, base, info] forWidth:width];
 }
 
 MSInstanceMessageHook1(CGSize, NSString, sizeWithFont, UIFont *, font) {