I tried out NSMutableAttributedString
to stylise my font with this code:
NSMutableAttributedString* attString = [[NSMutableAttributedString alloc] initWithString:element04.text];
NSRange range = NSMakeRange(0, [attString length]);
[attString addAttribute:NSFontAttributeName value:element04.font range:range];
[attString addAttribute:NSForegroundColorAttributeName value:element04.textColor range:range];
NSShadow* shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor colorWithRed:30/255 green:11/255 blue:0/255 alpha:1];
shadow.shadowOffset = CGSizeMake(2.0f, 2.0f);
[attString addAttribute:NSShadowAttributeName value:shadow range:range];
[attString addAttribute:NSStrokeColorAttributeName value:[UIColor colorWithRed:30/255 green:11/255 blue:0/255 alpha:1] range:range];
[attString addAttribute:NSStrokeWidthAttributeName value:[NSNumber numberWithFloat:-2.0] range:range];
element04.attributedText = attString;
The issue here is that there are border at the shadow. How can I add border to the text with the shadow that has no border?