Quark #

Modules #

Quark v1.2.0 Documentation


quark/font #

Class: FontPool #

FontPool #

Manage all font types.

An FFID represents a group of font families.
Usually a text needs multiple fonts to represent it, first, alternative, and exception.

fontpool.countFamilies #

The number of font families currently being read

fontpool.defaultFamilyNames #

List of default font family names

  • @get defaultFamilyNames: string[]

fontpool.defaultFontFamilies #

Default font family name FFID

fontpool.getFontFamilies(families?) #

Get the font FFID by name. Use , to separate multiple names.

For example:

var ffid = pool.getFontFamilies('黑体,PingFang-SC')
console.log(getFamiliesName(ffid))

fontpool.addFontFamily(data,alias?) #

Add an external font

fontpool.getFamilyName(index) #

Read font family name by index

getFontFamilies(families?) #

Get the font family object FFID by font family name

getFamiliesName(ffid) #

Get the name by font family FFID