Skip to content
santhoshtr edited this page Aug 9, 2012 · 6 revisions

init

  • arguments - None
  • return - None
  • description - Initializes the extension. This method applies a default font for the language of the element. Language of the element is lang attribute of the node or lang attribute of the html element. After that, it parses the whole element subnodes. See parse method. The init method is called from Constructor of the webfonts extension.

apply

  • arguments - a) fontFamily, b) Optional $element
  • return - None
  • description - apply a font to the current element. If an optional jquery object $element passed, use that. This method adds an inline style font-family: fontFamily, fallbacks to the the element. Default font fallbacks are 'Helvetica', 'Arial', 'sans-serif'. Font fall back can be changed using the option fontStack

parse

  • arguments - None
  • return - None
  • description -

reset

  • arguments - None
  • return - None
  • description - Reset the elements font to its original font.

load

  • arguments - String fontfamily - font family name
  • return - None
  • description - Load a given font. It checks whether it is already loaded or not. If not loaded already, it gets the configuration from the repository, create the css and inject to the page.

unbind

  • arguments - None
  • return - None
  • description - Unbind the jquery webfonts extension from an element

list

  • arguments - Optional string langCode
  • return - Array of font names
  • description - Returns a list of font names supported by the current repository. If language is passed as argument, fonts for that language is returned

languages

  • arguments - None
  • return - Array of language codes
  • description - Returns a list of languages supported by the current font repository

getCSS

  • arguments -
    a) fontFamily The font-family name b) variant Optional font variant
  • return - String -The @font-face css rule for the arguments
  • description - For the given font family and optional variant, return @font-face css style

Clone this wiki locally