indexing description: "[ An EM_CHARACTER contains a CHARACTER that can be drawn to an EM_SURFACE using an EM_FONT. ]" date: "$Date$" revision: "$Revision$" class EM_CHARACTER inherit EM_DRAWABLE create make feature -- Initialization make ( a_character: CHARACTER; a_font: EM_FONT ) is -- Create an EM_CHARACTER containing `a_character' using `a_font'. require a_font_not_void: a_font /= void do font := a_font character := a_character set_visible (True) ensure is_visible: is_visible end feature -- Measurement width: INTEGER is -- Width of character do result := font.width (character) end height:INTEGER is -- Height of character do result := font.height (character) end feature -- Access character: CHARACTER -- Character to draw font: EM_FONT -- Font to use to draw `character' feature -- Element change set_character (a_character: like character) is -- Set `character' to `a_character'. do character := a_character end set_font (a_font: like font) is -- Set `font' to `a_font'. require a_font_not_void: a_font /= void do font := a_font ensure font_set: font = a_font end feature -- Drawing draw (a_surface: EM_SURFACE) is -- Draw character to `a_surface'. do if is_visible then font.draw (character, a_surface, x, y) end end invariant a_font_not_void: font /= void end