Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.What font is used as a 'small font' in typical Mac OS X apps?
Xojo 4.5 has a constant "SmallSystem" to use for a font name.
For older versions try this code:
Sub GetThemeFont(fontType as Integer, ByRef fontName as String, ByRef fontSize as Integer, ByRef fontStyle as Integer)
dim err as Integer
dim theFont, theFontSize, theFontStyle as MemoryBlock

const smSystemScript = -1

Declare Function GetThemeFont Lib "Carbon" (inFontID as Integer, inScript as Integer, outFontName as Ptr, outFontSize as Ptr, outStyle as Ptr) as Integer

theFont = NewMemoryBlock(256) //Str255
theFontSize = NewMemoryBlock(2) //SInt16
theFontStyle = NewMemoryBlock(1) //Style

err = GetThemeFont(fontType, smSystemScript, theFont, theFontSize, theFontStyle)

if err = 0 then
fontName = theFont.PString(0)
fontSize = theFontSize.UShort(0)
fontStyle = theFontStyle.Byte(0)
fontName = ""
fontSize = 0
fontStyle = 0
end if
End Sub

Feedback, Comments & Corrections

The biggest plugin in space...

MBS Xojo Plugins