lundi 28 avril 2014

Fuzzy lines when outlining text in UILabel


Vote count:

0




I'm using a bit of code based on an answer I found here



- (void)drawTextInRect:(CGRect)rect {

CGSize shadowOffset = self.shadowOffset;

CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(c, 3.5);
CGContextSetLineJoin(c, kCGLineJoinRound);

CGContextSetTextDrawingMode(c, kCGTextStroke);
self.textColor = _outlineColor;
[super drawTextInRect:rect];

CGContextSetTextDrawingMode(c, kCGTextFill);
self.textColor = _mainTextColor;
self.shadowOffset = CGSizeMake(0, 0);
[super drawTextInRect:rect];

self.shadowOffset = shadowOffset;

}


My problem is that the text is a little bit fuzzy around the letters, particularly around the 'A' letters, as you can see here:


Fuzzy Outlined UILabel


Does anyone know a way that I can clean this up? It seems small, but it really does stand out on the retina displays in particular.



asked 22 secs ago

Logan

3,222





Aucun commentaire:

Enregistrer un commentaire