Defines the client-side cw.FontIcons library, which maps Font Awesome icon names such as fa-star to their characters and draws them.

cw.FontIcons:GetIcon returns the character for a name and cw.FontIcons:Draw draws an icon at a given size and color with the cwFontAwesome font, which this file registers. Most of the file is the table of icon names and character codes.

Font Awesome's creators and license can be found at http://fontawesome.io/.

Summary

Methods

Draws a Font Awesome icon.
Returns the Font Awesome character for an icon name.

Methods

cw.FontIcons:Draw(id, x, y, size, color)

client gamemodes/catwork/gamemode/core/libraries/cl_fontawesome.lua:703

Draws a Font Awesome icon.

The name may be written as 'fa fa-star', 'fa-star' or 'star'. Draws nothing if the icon is not known.

cw.FontIcons:Draw('fa-user', 4, 4, 24, Color(255, 200, 0))

Parameters

  • id String Name of the icon
  • x Number Horizontal position
  • y Number Vertical position
  • size Number optional, defaults to 16 Size of the icon in pixels
  • color Color optional, defaults to Color(255,255,255) Color of the icon

See also

Returns the Font Awesome character for an icon name.

Draw the result with the cwFontAwesome font.

Parameters

  • id String Full icon name, such as 'fa-star'

Returns

  • String The icon's UTF-8 character, or id unchanged if it is not a known icon

See also

Defined in