+ return MSOldCall(resource, type);
+}
+// }}}
+
+static struct WBStringDrawingState {
+ WBStringDrawingState *next_;
+ unsigned count_;
+ NSString *base_;
+ NSString *info_;
+} *stringDrawingState_;
+
+MSInstanceMessageHook6(CGSize, NSString, drawAtPoint,forWidth,withFont,lineBreakMode,letterSpacing,includeEmoji, CGPoint, point, float, width, UIFont *, font, int, mode, float, spacing, BOOL, emoji) {
+ WBStringDrawingState *state(stringDrawingState_);
+ if (state == NULL)
+ return MSOldCall(point, width, font, mode, spacing, emoji);
+
+ if (--state->count_ == 0)
+ stringDrawingState_ = state->next_;
+ if (state->info_ == nil)
+ return MSOldCall(point, width, font, mode, spacing, emoji);
+
+ NSString *info([Info_ objectForKey:state->info_]);
+ if (info == nil)
+ return MSOldCall(point, width, font, mode, spacing, emoji);
+
+ NSString *base(state->base_ ?: @"");
+ NSString *extra([NSString stringWithFormat:@"letter-spacing: %gpx", spacing]);
+ [self drawAtPoint:point withStyle:[NSString stringWithFormat:@"%@;%@;%@;%@", [font markupDescription], extra, base, info]];
+ return CGSizeZero;
+}
+
+MSInstanceMessageHook7(CGSize, NSString, _drawInRect,withFont,lineBreakMode,alignment,lineSpacing,includeEmoji,truncationRect, CGRect, rect, UIFont *, font, int, mode, int, alignment, float, spacing, BOOL, emoji, CGRect, truncation) {
+ WBStringDrawingState *state(stringDrawingState_);
+ if (state == NULL)
+ return MSOldCall(rect, font, mode, alignment, spacing, emoji, truncation);
+
+ if (--state->count_ == 0)
+ stringDrawingState_ = state->next_;
+ if (state->info_ == nil)
+ return MSOldCall(rect, font, mode, alignment, spacing, emoji, truncation);
+
+ NSString *info([Info_ objectForKey:state->info_]);
+ if (info == nil)
+ return MSOldCall(rect, font, mode, alignment, spacing, emoji, truncation);
+
+ NSString *textAlign;
+ switch (alignment) {
+ default:
+ case WebTextAlignmentLeft:
+ textAlign = @"left";
+ break;
+ case WebTextAlignmentCenter:
+ textAlign = @"center";
+ break;
+ case WebTextAlignmentRight:
+ textAlign = @"right";
+ break;
+ }
+
+ NSString *base(state->base_ ?: @"");
+ NSString *extra([NSString stringWithFormat:@"text-align: %@", textAlign]);
+ [self drawInRect:rect withStyle:[NSString stringWithFormat:@"%@;%@;%@;%@", [font markupDescription], extra, base, info]];
+ return CGSizeZero;