MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.What font is used as a 'small font' in typical Mac OS X apps?

REALbasic 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

MBS Xojo PDF Plugins