@@ -114,6 +114,7 @@ int main(void)
114114 }
115115
116116 prevUnicodeRange = unicodeRange ;
117+ SetTextureFilter (font .texture , TEXTURE_FILTER_BILINEAR ); // Set font atlas scale filter
117118 }
118119
119120 if (IsKeyPressed (KEY_ZERO )) unicodeRange = 0 ;
@@ -130,7 +131,7 @@ int main(void)
130131
131132 ClearBackground (RAYWHITE );
132133
133- DrawText ("ADD CODEPOINTS: 1,2,3,4 " , 20 , 20 , 20 , MAROON );
134+ DrawText ("ADD CODEPOINTS: [1][2][3][4] " , 20 , 20 , 20 , MAROON );
134135
135136 // Render test strings in different languages
136137 DrawTextEx (font , "> English: Hello World!" , (Vector2 ){ 50 , 70 }, 32 , 1 , DARKGRAY ); // English
@@ -142,11 +143,13 @@ int main(void)
142143 //DrawTextEx(font, "देवनागरी: होला मुंडो!", (Vector2){ 50, 350 }, 32, 1, DARKGRAY); // Devanagari (glyphs not available in font)
143144
144145 // Draw font texture scaled to screen
145- DrawRectangle (400 , 16 , 380 , 400 , BLACK );
146+ float atlasScale = 380.0f /font .texture .width ;
147+ DrawRectangle (400 , 16 , font .texture .width * atlasScale , font .texture .height * atlasScale , BLACK );
146148 DrawTexturePro (font .texture , (Rectangle ){ 0 , 0 , font .texture .width , font .texture .height },
147- (Rectangle ){ 400 , 16 , font .texture .width * 0.5f , font .texture .height * 0.5f }, (Vector2 ){ 0 , 0 }, 0.0f , WHITE );
149+ (Rectangle ){ 400 , 16 , font .texture .width * atlasScale , font .texture .height * atlasScale }, (Vector2 ){ 0 , 0 }, 0.0f , WHITE );
150+ DrawRectangleLines (400 , 16 , 380 , 380 , RED );
148151
149- DrawText (TextFormat ("ATLAS SIZE: %ix%i px" , font .texture .width , font .texture .height ), 20 , 380 , 20 , BLUE );
152+ DrawText (TextFormat ("ATLAS SIZE: %ix%i px (x%02.1f) " , font .texture .width , font .texture .height , atlasScale ), 20 , 380 , 20 , BLUE );
150153
151154 // Display font attribution
152155 DrawText ("Font: Noto Sans TC. License: SIL Open Font License 1.1" , screenWidth - 300 , screenHeight - 20 , 10 , GRAY );
0 commit comments