Skip to content

Commit d421016

Browse files
committed
More comments
1 parent 4aa06d7 commit d421016

File tree

1 file changed

+8
-3
lines changed
  • common/src/main/kotlin/com/lambda/graphics/renderer/gui/font/glyph

1 file changed

+8
-3
lines changed

common/src/main/kotlin/com/lambda/graphics/renderer/gui/font/glyph/FontGlyphs.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,17 @@ class FontGlyphs(font: Font) {
7272
charMap[char.code]
7373

7474
companion object {
75+
// The space between glyphs is necessary to prevent artifacts from appearing when the font texture is blurred
76+
private const val STEP = 2
77+
7578
// Since most Lambda users probably have bad pc, the default size is 2048, which includes latin, cyrillic, greek and arabic
7679
// and in the future we could grow the textures when needed
7780
private const val CHAR_AMOUNT = 2048
78-
private const val TEXTURE_SIZE = 4096
81+
82+
// The size of the texture in pixels
83+
private const val TEXTURE_SIZE = CHAR_AMOUNT * 2
84+
85+
// The size of one texel in UV coordinates
7986
private const val ONE_TEXEL_SIZE = 1.0 / TEXTURE_SIZE
80-
// The space between glyphs is necessary to prevent artifacts from appearing when the font texture is blurred
81-
private const val STEP = 2
8287
}
8388
}

0 commit comments

Comments
 (0)