Is there a way to find the fonts names?

BlitzPlus Forums/BlitzPlus Programming/Is there a way to find the fonts names?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Phew, done! It's not perfect, but it gets the job done. You can download it here: Blitz.FontApi. For some reason it doesn't like Arial, but all the other fonts I've tested work.

To use it include "Blitz_Font_TTF.bb" and "Blitz_Basic_Endian.bb" (both are included in that archive). The following examples shows how to get the font name and copyright notice.

; Endian support
Include "Blitz_Basic_Endian.bb"

; Load the font
Local myFont.TTF = TTF_Load("C:/Windows/Fonts/Verdana.ttf")

; Print some details
Print "This font's family is called: " + TTF_GetFontName(myFont)
Print "Copyright: " + TTF_Name_GetProperty(myFont, TTF_NAME_ID_COPYRIGHT)

; Cleanup
TTF_Dispose(myFont)


Hope that helps!