Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.video.font

Class EM_BMP_FONT


Direct ancestors

EM_FONT

Creation

Features

Invariants

indexing

description

An EM_BMP_FONT expect a EM_DRAWABLE that contains all the 256 ASCII characters
It is a matrix of size 16x16. Every entry contains one character. The
character with the ASCII number 0 is at the top left, the character
with the number 255 is at the bottom right. You can build such matrixes with
the help of www.lmnopc.com/bitmapfontbuilder/

date

$Date: 2005/10/23 10:59:04 $

revision

$Revision: 1.7 $

class

EM_BMP_FONT

inherit

EM_FONT

create

make (a_drawable: EM_DRAWABLE)

-- Create an EM_BMP_FONT out of a_drawable that contains the font data.

require
a_drawable_not_void: a_drawable/=void

feature -- Initialization

make (a_drawable: EM_DRAWABLE)

-- Create an EM_BMP_FONT out of a_drawable that contains the font data.

require
a_drawable_not_void: a_drawable/=void

feature -- Measurement

height (a_character: CHARACTER): INTEGER

-- Height of a_character. All characters have same height.

-- (From EM_FONT)

string_height (a_string: STRING): INTEGER

-- Height of a_string. All strings have same height.

-- (From EM_FONT)

string_width (a_string: STRING): INTEGER

-- Width of a_string.

-- (From EM_FONT)

width (a_character: CHARACTER): INTEGER

-- Width of a_character. All characters have same width.

-- (From EM_FONT)

feature -- Drawing

draw (a_character: CHARACTER; a_surface: EM_SURFACE; x: INTEGER; y: INTEGER)

-- Draw a_character to a_surface to position x y.

-- (From EM_FONT)

require
a_surface /= void
draw_part (rect: EM_RECT; a_character: CHARACTER; a_surface: EM_SURFACE; x: INTEGER; y: INTEGER)

-- Draw rect part of a_character to a_surface to position x y.

-- (From EM_FONT)

require
a_surface /= voidrect /= void
draw_string (a_string: STRING; a_surface: EM_SURFACE; x: INTEGER; y: INTEGER)

-- Draw a_string to a_screen to position x y.

-- (From EM_FONT)

require
a_string_not_void: a_string /= void and then a_string.count > 0
a_surface_not_void: a_surface /= void

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end