Module: ko/fonts

Retrieve and parse available system fonts

Methods


require("ko/fonts").getEffectiveFont()

Take a font list (as used in CSS) and return the first font in the list that exists on the system

Returns:

name of font

Type
String

require("ko/fonts").getMonoFonts()

Get available mono fonts

This compares all available system fonts against a database of known mono fonts, because unfortunately there is no cross-platform method of identifying mono fonts.

Returns:

List of font names

Type
Array

require("ko/fonts").getSystemFonts()

Get all available system fonts

Returns:

List of fonts

Type
Array