Manage to write a correct renderFontToTexture function