The OpenD Programming Language

OperatingSystemFont.listFonts

Lists available fonts from the system that match the given pattern, finding names that are suitable for passing to OperatingSystemFont's constructor.

More...
class OperatingSystemFont
static
void
listFonts
(
string pattern
,
bool delegate
(
in char[] name
)
handler
)

Detailed Description

Fonts will be fed to you (possibly! it is platform and implementation dependent on if it is called immediately or later) asynchronously through the given delegate. It should return true if you want more, false if you are done. The delegate will be called once after finishing with a init value to let you know it is done and you can do final processing.

If pattern is null, it returns all available font families.

Please note that you may also receive fonts that do not match your given pattern. You should still filter them in the handler; the pattern is really just an optimization hint rather than a formal guarantee.

The format of the pattern is platform-specific.

Meta

History

Added May 1, 2021 (dub v9.5)