Gamalto

Fork me on GitHub

Object Font Overview

Gamalto. Font

new Gamalto.Font(bitmap, firstLetter)

Creates a new graphical font from a bitmap.

Parameters
Name Type Description
bitmap Gamalto.Bitmap

Image holding the font data.

firstLetter string

First character of the font.

Extends

Members

length :number

inherited readonly

Number of items in the list.

Inherited From

tag :object

inherited

Utility property to exchange data between objects.

Inherited From

Methods

addSections(size, countopt, ropt) Gamalto.SpriteSheet

inherited

Adds a new set of sprites to the list using the specified parameters.

Parameters
Name Type Attributes Description
size Gamalto.Size

Size of a sprite.

count number <optional>

Number of sprite sections to compute. Defaults to the number of sections contained in the specified rectangle.

r Gamalto.IBox <optional>

Rectangle defining the bounds of the container. Defaults to the bitmap bounds.

Inherited From
Returns
  • Current object for method chaining.

clone() object

inherited abstract

Clones the object. It will be shallow copy unless otherwise specfied.

Inherited From
Returns
  • New instance of the object. Defaults to null.

draw(renderer, text, x, y) Gamalto.Size

override

Draws a text into a surface.

Parameters
Name Type Description
renderer Gamalto.BaseRenderer

Renderer of the surface where the text must be drawn.

text string

Text to be drawn.

x number

Horizontal drawing position.

y number

Vertical drawing position.

Overrides
Returns
  • Size of drawn text.

getSection(index) object

inherited

Gets the section at the specified index.

Parameters
Name Type Description
index number

Zero-based index of the section.

Inherited From
Returns
  • Requested section. The type depends on the implementation.

insertSection(at, section)

inherited

Inserts an existing section into the list.

Parameters
Name Type Description
at number

Zero-based index where the section must be inserted.

section object

Section to be added. The type depends on the implementation.

Inherited From

measureText(text) Gamalto.Size

Computes the size of the specified text in pixels.

Parameters
Name Type Description
text string

Text to be measured.

Returns
  • Size of the text.

setMargin(x, y)

inherited

Sets the global margin around the sections in the container.

Parameters
Name Type Description
x number

Horizontal margin.

y number

Vertical margin.

Inherited From

setSpacing(x, y)

inherited

Sets the spacing around a section in the container.

Parameters
Name Type Description
x number

Horizontal spacing between sections.

y number

Vertical spacing between sections.

Inherited From

toString() string

inherited abstract

Converts the object into a string.

Inherited From
Returns
  • string

Documentation generated by JSDoc 3.3.2 on Sun Sep 13 2015 20:13:31 GMT+0200 (CEST)