-- xtra FontList -- v0.4 (c) 2017 Valentin Schmidt new object me getFontFamilies object me getFonts object me, *displayNameFlag, filter showFontPicker object me, symbol chHandler, *cbTarget, fntNameString, fntSizeFloat ---------------------------------------- getFontFamilies () ---------------------------------------- Returns string list of all font families available in the current system. ---------------------------------------- getFonts (*bool displayNameFlag, integer filter) ---------------------------------------- Returns string list of all individual fonts available in the current system. If optional parameter 'displayNameFlag' is specified and TRUE, strings in the returned list are (localized) displayNames, otherwise they are fontNames, as used in the PostScript language code. You can specify an optional filter value to query only specific fonts. ---------------------------------------- showFontPicker (symbol chHandler, *cbTarget, fntNameString, fntSizeFloat) ---------------------------------------- Shows a system font picker dialog. The font selected by the user is passed to callback handler 'cbHandler' (optionally of object 'cbTarget', default = _movie) when the dialog is closed. You can optionally also specify a default font name (e.g. "Arial") and a default size (as float, e.g. 18.0). Filter Masks ============ The following list shows the available values for this filter parameter, multiple masks are combined by using Lingo's bitOr() function. -- mask that specifies a bold font. NSBoldFontMask = 2 -- mask that specifies a compressed font. NSCompressedFontMask = 512 -- mask that specifies a condensed font. NSCondensedFontMask = 64 -- mask that specifies an expanded font. NSExpandedFontMask = 32 -- mask that specifies a fixed pitch font. NSFixedPitchFontMask = 1024 -- mask that specifies an italic font. NSItalicFontMask = 1 -- mask that specifies a narrow font. NSNarrowFontMask = 16 -- mask that specifies a font that uses a non-standard character set. NSNonStandardCharacterSetFontMask = 8 -- mask that specifies a poster-style font. NSPosterFontMask = 256 -- mask that specifies a small-caps font. NSSmallCapsFontMask = 128 -- mask that specifies a font that is not bold. NSUnboldFontMask = 4 -- mask that specifies a font that is not italic. NSUnitalicFontMask = 16777216 Note ===== Not all bitOr() combinations make sense, some pairs are mutually exclusive: - NSCondensedFontMask and NSExpandedFontMask - NSBoldFontMask and NSUnboldFontMask - NSItalicFontMask and NSUnitalicFontMask Usage Examples ============== -- return all bold fonts NSBoldFontMask = 2 filter = NSBoldFontMask fonts = getFonts(filter) -- return all bold-italic fonts NSBoldFontMask = 2 NSItalicFontMask = 1 filter = bitOr(NSBoldFontMask, NSItalicFontMask) fonts = getFonts(filter)