#Unexpected stride skewing in font depending on DPI and Size

2 messages · Page 1 of 1 (latest)

limpid plaza
#

Howdy!

I've made multiple projects in OpenGL in various languages that need a text atlas which I've implemented.

But they all seem to have issues in regards to unexpected skewing in the resulting atlas image generated. When I first created it in C++ I had to copy the rasterized glyphs onto the atlas image manually, so I just figured it was a skill issue on my part calculating the offsets wrong.

But now I'm doing an OpenGL project in Go, also making an atlas, and it has lots of fancy STD features for when it comes to software rasterization and drawing & copying images from one place to another, so I doubt that there's a bug in there.

And now when I select the DPI and Size for the font face, if I pick the wrong combinations it seems to always want to do some insane skewing, even tho to me it seems that the code of uploading the image to an OpenGL texture seems fine to me, with correct width & height calculations and all that.

I want less answers on how to specifically fix this, but more a general intuiton or understanding for why this is an issue.

Attached images are an atlas when I pick the right point size & DPI combination, and when I don't.

The repo is at https://github.com/Aurora2500/chemists-lab for code.

GitHub

Contribute to Aurora2500/chemists-lab development by creating an account on GitHub.

#

I'd have figured that an incorrect DPI would just like make the pixels look less crisp in some spots or whatever, but it just skews like crazy