BufferedImage drawString corrupted letters

I'm writing a program in Kotlin to run on Raspberry Pi. I'm using a small 128x64 pixel OLED display

To display a text I'm drawing it on BufferedImage and then display that image

val bufferedImage = BufferedImage(128, 64, BufferedImage.TYPE_INT_RGB)

val g = bufferedImage.createGraphics()

g.paint = Color.WHITE

g.font = Font("PixelMix", Font.BOLD, /*Font size*/8)

g.drawString("IP:", 0, 24)


display.drawImage(bufferedImage, 0, 0)

link to font: https://www.dafont.com/pixelmix.font

Because screen space is very limited I use small font.

But here comes the problem - following code produces image in which the first 1 lack vertical line, while last 1 is a square.

When I do g.font...

Read More »

By: StackOverFlow - Friday, 9 November

Related Posts

  • Older News
  • How to display value of epsilon exactly StackOverFlow (Yesterday) - I have to find a root of equation with Bisection method.Inside Graphicsfloat a,b,x = 0,c, eps = 0.0001f;int xi=0;Iteration f = new Iteration();a=-2.5f;b=-2f;int dy = 0;while( Math.abs(a-b) > eps) {c...
  • Unable to run swirl for image java StackOverFlow (3 days ago) - about this image swirl why i can't get the output?? public class ImageProcessor {buffer of image data.)public static BufferedImage copy(BufferedImage img) {BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);Graphics g =...