I’m writing on an image using:
float shadowColorValues[] = {0, 0, 0, .3};
CGContextSetShadowWithColor(context, CGSizeMake (2, -2), 3 * imageScale, shadowColor);
CGContextSelectFont(context, newFontName, fontSize, kCGEncodingMacRoman);
CGContextSetRGBFillColor(context, 255, 255, 255, 1);
CGContextSetRGBStrokeColor(context, 255, 255, 255, 1);
CGContextSetTextDrawingMode(context, kCGTextFill);
CGContextSetTextMatrix(context, CGAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0));
CGContextShowTextAtPoint(context, textX, textY, newText, strlen(newText));
If I’m using a font like Chalkduster the result is very pixelated: https://i.stack.imgur.com/heGu1.png. What am I doing wrong?
Make sure to use
when creating the image context.