Request_ImageFont

BlitzMax Forums/BlitzMax Beginners Area/Request_ImageFont

TAS(Posted 2012) [#1]
Is there something similar to RequestFont:TGuiFont() for ImageFonts? Or way to go from a TGuiFont to a Imagefont?


Bobysait(Posted 2012) [#2]
the TGuiFont provide some usefull fields
-> Name$, Style and Size should be enough for you to load the appropriate TImageFont


Local GuiFont:TGuiFont = LoadGuiFont(......)
[...]

Local GuiStyle = GuiFont.Style
Local BmxStyle = SMOOTHFONT ' or 0 ... as you like
If GuiFont.Style And FONT_BOLD Then BmxStyle:+BOLDFONT
If GuiFont.Style And FONT_ITALIC Then BmxStyle:+ITALICFONT
Local BmxFont:TImageFont = LoadImageFont(GuiFont.Name, GuiFont.Size, BmxStyle)


TAS(Posted 2012) [#3]
Thanks,
Hmm, It might be possible to search the Font folder for a filename that contains GuiFont.name. I ended up rolling my own requester that displays the file names in the Font font folder a lets look at some example text in the selected font and size.


Bobysait(Posted 2012) [#4]
use the RequestFile() command, you should probably do what you want using the filters