Improved TImageFonts
BlitzMax Forums/BlitzMax Module Tweaks/Improved TImageFonts
| ||
I've been having issues getting the Image Fonts to look nice at any scale... I had a root through the code and found the cause in imagefont.bmx in the Max2d.mod First thing I noticed was Line 76 : glyph._image=TImage.Load( pixmap.Copy(),0,0,0,_imageFlags ) Which according to the function it is calling it should be changed to: glyph._image=TImage.Load( pixmap.Copy(),_imageFlags,0,0,0 ) I also noticed that there was no MIPMAPPEDIMAGE applied when using the SMOOTHFONT flag, so I changed Line 111 to : If style & SMOOTHFONT font._imageFlags=FILTEREDIMAGE|MIPMAPPEDIMAGE Oh and make sure you've got BlendMode(ALPHABLEND) set. Now my fonts look real sexy :D |
| ||
Hi, Well spotted - thanks! |
| ||
Is this something that we should Sync Mods for? |
| ||
[edited for clarity] -- Should not post when drinking :P |
| ||
nice :) |
| ||
Nice one m8. |
| ||
Hi, is this bug fix for version 1.10? I still have 1.09 and imagefont.bmx looks different (though it still does not work well). Is this fixed in the latest modules? |
| ||
Great job Tim! I would also like to know if this has been fixed for the 1.10 release? |
| ||
Hi Indiepath, ive applied your fix and then run the bmk makemods command, however im still seeing blurring and lines being missed off with the setimagefont and drawtext commands. Can someone else try the following code, you need to move the text around until you get the x or y co-ordinate on a non-whole number (e.g. x=320.5). When this happens the text goes blurry and a line or two seems to get sliced from the side or top of the text: SetGraphicsDriver GLMax2DDriver () bglSetSwapInterval(1) Graphics(800,600,32) arial_font = LoadImageFont("C:\WINDOWS\FONTS\ARIAL.TTF", 20, SMOOTHFONT) SetImageFont(arial_font) SetBlend(ALPHABLEND) Local x:Float = GraphicsWidth() / 2 Local y:Float = GraphicsHeight() / 2 While Not KeyHit(KEY_ESCAPE) If KeyDown(KEY_UP) y :- 0.5 Else If KeyDown(KEY_DOWN) y :+ 0.5 End If If KeyDown(KEY_LEFT) x :- 0.5 Else If KeyDown(KEY_RIGHT) x :+ 0.5 End If Cls DrawText("SCROLLY TEXT....", x, y) DrawText("More Text", x, y + 15) DrawText("X = " + x + "Y = " + y, 10, 10) Flip() Wend |
| ||
I get the line clipping too. I have not applied the fix, but have synced modules. |
| ||
The text in the above example seems fine on my windows machine. Have these changes been included in the sync mods stuff? My install is up to date with the latest. |
| ||
Nah, this quite essential bug fix still hasn't been updated. |
| ||
yey it's in the new update. |
| ||
Is your 2d texture thing used for lighting in as well? |