CanvasImage textImage = graphics().createImage((int)layout.width(), (int)layout.height());
Maybe Michael can explain theory behind this issue :)
Hi,I'm having some trouble with text rendering on iOS, you can see on the attached screenshot that there are some artifact lines on top of rendered text.
--
---
You received this message because you are subscribed to the Google Groups "PlayN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to playn+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<ios_text_artifact.png>
CanvasImage textImage = graphics().createImage(Math.round(layout.width()), Math.round(layout.height()));
and it works as well, but not without quantization. By the way I'm using Playn 1.7
private Layer createTextLayer(String text, float w, float h){
Font font = graphics().createFont("CoolveticaRg", Font.Style.PLAIN, h/3f);
TextLayout layout = graphics().layoutText(text, new TextFormat().withFont(font));
CanvasImage textImage = graphics().createImage((float)Math.ceil(layout.width()), (float)Math.ceil(layout.height()));
textImage.canvas().setFillColor(iconColor);
textImage.canvas().fillText(layout, 0, 0);
ImageLayer txtLayer = graphics().createImageLayer(textImage);
txtLayer.setOrigin(0, layout.height()/2f);
return txtLayer;
txtLayer.setOrigin(0, layout.height()/2f);
And my text is blurry, do you have any hints how to fix that?