    indexing
    	description: "Eiffel Vision font. Implementation interface."
    	legal: "See notice at end of class."
    	status: "See notice at end of class."
    	keywords: "character, face, height, family, weight, shape, bold, italic"
    	date: "$Date: 2006-03-22 23:29:03 -0800 (Wed, 22 Mar 2006) $"
    	revision: "$Revision: 57641 $"

    deferred class interface
    	EV_FONT_I

    feature -- Access

    	char_set: INTEGER_32
    			-- Charset

    	family: INTEGER_32
    			-- Preferred font category.

    	generating_type: STRING_8
    			-- Name of current object's generating type
    			-- (type of which it is a direct instance)
    			-- (from ANY)

    	generator: STRING_8
    			-- Name of current object's generating class
    			-- (base class of the type of which it is a direct instance)
    			-- (from ANY)

    	height: INTEGER_32
    			-- Preferred font height measured in screen pixels.

    	height_in_points: INTEGER_32
    			-- Preferred font height in pixels.

    	preferred_families: EV_ACTIVE_LIST [STRING_32]
    			-- Preferred user fonts.
    			-- family will be ignored when not Void.

    	shape: INTEGER_32
    			-- Preferred font slant.

    	weight: INTEGER_32
    			-- Preferred font thickness.

    feature -- Comparison

    	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void
    			-- or attached to isomorphic object structures?
    			-- (from ANY)
    		ensure -- from ANY
    			shallow_implies_deep: standard_equal (some, other) implies Result
    			both_or_none_void: (some = Void) implies (Result = (other = Void))
    			same_type: (Result and (some /= Void)) implies some.same_type (other)
    			symmetric: Result implies deep_equal (other, some)

    	frozen equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached
    			-- to objects considered equal?
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

    	is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object considered
    			-- equal to current object?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			symmetric: Result implies other.is_equal (Current)
    			consistent: standard_is_equal (other) implies Result

    	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
    			-- Are `some' and `other' either both void or attached to
    			-- field-by-field identical objects of the same type?
    			-- Always uses default object comparison criterion.
    			-- (from ANY)
    		ensure -- from ANY
    			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

    	frozen standard_is_equal (other: like Current): BOOLEAN
    			-- Is `other' attached to an object of the same type
    			-- as current object, and field-by-field identical to it?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			same_type: Result implies same_type (other)
    			symmetric: Result implies other.standard_is_equal (Current)

    feature -- Status report

    	ascent: INTEGER_32
    			-- Vertical distance from the origin of the drawing
    			-- operation to the top of the drawn character.

    	conforms_to (other: ANY): BOOLEAN
    			-- Does type of current object conform to type
    			-- of `other' (as per Eiffel: The Language, chapter 13)?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void

    	descent: INTEGER_32
    			-- Vertical distance from the origin of the drawing
    			-- operation to the bottom of the drawn character.

    	horizontal_resolution: INTEGER_32
    			-- Horizontal resolution of screen for which the font is designed.

    	is_proportional: BOOLEAN
    			-- Can characters in the font have different sizes?

    	maximum_width: INTEGER_32
    			-- Width of the biggest character in the font.

    	minimum_width: INTEGER_32
    			-- Width of the smallest character in the font.

    	name: STRING_32
    			-- Face name chosen by toolkit.

    	same_type (other: ANY): BOOLEAN
    			-- Is type of current object identical to type of `other'?
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			definition: Result = (conforms_to (other) and other.conforms_to (Current))

    	string_size (a_string: STRING_GENERAL): TUPLE [INTEGER_32, INTEGER_32, INTEGER_32, INTEGER_32]
    			-- [width, height, left_offset, right_offset] in pixels of `a_string' in the current font,
    			-- taking into account line breaks ('%N').
    			-- width and height correspond to the rectange used to bound `a_string', and
    			-- should be used when placing strings next to each as part of a text.
    			-- On some fonts, characters may extend outside of the bounds given by width and height,
    			-- for example certain italic letters may overhang other letters. Use `left_offset' and
    			-- `right_offset' to determine if there is any overhang for `a_string'. a negative `left_offset'
    			-- indicates overhang to the left, while a positive `right_offset' indicates an overhang to the right.
    			-- To determine the complete bounding rectangle for `a_string' add negative `left_offset'
    			-- and positive `right_offset' to width.
    		require
    			a_string_not_void: a_string /= Void

    	string_width (a_string: STRING_GENERAL): INTEGER_32
    			-- Width in pixels of `a_string' in the current font.
    		require
    			a_string_not_void: a_string /= Void
    		ensure
    			positive: Result >= 0

    	vertical_resolution: INTEGER_32
    			-- Vertical resolution of screen for which the font is designed.

    	width: INTEGER_32
    			-- Character width of current fixed-width font.

    feature -- Element change

    	set_family (a_family: INTEGER_32)
    			-- Set `a_family' as preferred font category.
    		require
    			a_family_valid: valid_family (a_family)
    		ensure
    			family_assigned: family = a_family

    	set_height (a_height: INTEGER_32)
    			-- Set `a_height' as preferred font size.
    		require
    			a_height_bigger_than_zero: a_height > 0
    		ensure
    			height_assigned: height = a_height

    	set_height_in_points (a_height: INTEGER_32)
    			-- Set `a_height_in_points' to `a_height'.
    		require
    			a_height_bigger_than_zero: a_height > 0
    		ensure
    			height_assigned: height_in_points = a_height

    	set_shape (a_shape: INTEGER_32)
    			-- Set `a_shape' as preferred font slant.
    		require
    			a_shape_valid: valid_shape (a_shape)
    		ensure
    			shape_assigned: shape = a_shape

    	set_values (a_family, a_weight, a_shape, a_height: INTEGER_32; a_preferred_families: like preferred_families)
    			-- Set `a_family', `a_weight', `a_shape' `a_height' and
    			-- `a_preferred_faces' at the same time for speed.
    		require
    			a_family_valid: valid_family (a_family)
    			a_weight_valid: valid_weight (a_weight)
    			a_shape_valid: valid_shape (a_shape)
    			a_height_bigger_than_zero: a_height > 0
    			a_preferred_families_not_void: a_preferred_families /= Void

    	set_weight (a_weight: INTEGER_32)
    			-- Set `a_weight' as preferred font thickness.
    		require
    			a_weight_valid: valid_weight (a_weight)
    		ensure
    			weight_assigned: weight = a_weight

    feature -- Duplication

    	copy (other: like Current)
    			-- Update current object using fields of object attached
    			-- to `other', so as to yield equal objects.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_equal: is_equal (other)

    	frozen deep_copy (other: like Current)
    			-- Effect equivalent to that of:
    			--		copy (`other' . deep_twin)
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, other)

    	frozen deep_twin: like Current
    			-- New object structure recursively duplicated from Current.
    			-- (from ANY)
    		ensure -- from ANY
    			deep_equal: deep_equal (Current, Result)

    	frozen standard_copy (other: like Current)
    			-- Copy every field of `other' onto corresponding field
    			-- of current object.
    			-- (from ANY)
    		require -- from ANY
    			other_not_void: other /= Void
    			type_identity: same_type (other)
    		ensure -- from ANY
    			is_standard_equal: standard_is_equal (other)

    	frozen standard_twin: like Current
    			-- New object field-by-field identical to `other'.
    			-- Always uses default copying semantics.
    			-- (from ANY)
    		ensure -- from ANY
    			standard_twin_not_void: Result /= Void
    			equal: standard_equal (Result, Current)

    	frozen twin: like Current
    			-- New object equal to `Current'
    			-- twin calls copy; to change copying/twining semantics, redefine copy.
    			-- (from ANY)
    		ensure -- from ANY
    			twin_not_void: Result /= Void
    			is_equal: Result.is_equal (Current)

    feature -- Basic operations

    	frozen default: like Current
    			-- Default value of object's type
    			-- (from ANY)

    	frozen default_pointer: POINTER
    			-- Default value of type `POINTER'
    			-- (Avoid the need to write `p'.default for
    			-- some `p' of type `POINTER'.)
    			-- (from ANY)

    	default_rescue
    			-- Process exception for routines with no Rescue clause.
    			-- (Default: do nothing.)
    			-- (from ANY)

    	frozen do_nothing
    			-- Execute a null action.
    			-- (from ANY)

    feature -- Constants

    	family_modern: INTEGER_32 is 5
    			-- (from EV_FONT_CONSTANTS)

    	family_roman: INTEGER_32 is 2
    			-- (from EV_FONT_CONSTANTS)

    	family_sans: INTEGER_32 is 3
    			-- (from EV_FONT_CONSTANTS)

    	family_screen: INTEGER_32 is 1
    			-- (from EV_FONT_CONSTANTS)

    	family_typewriter: INTEGER_32 is 4
    			-- (from EV_FONT_CONSTANTS)

    	shape_italic: INTEGER_32 is 11
    			-- (from EV_FONT_CONSTANTS)

    	shape_regular: INTEGER_32 is 10
    			-- (from EV_FONT_CONSTANTS)

    	weight_black: INTEGER_32 is 9
    			-- (from EV_FONT_CONSTANTS)

    	weight_bold: INTEGER_32 is 8
    			-- (from EV_FONT_CONSTANTS)

    	weight_regular: INTEGER_32 is 7
    			-- (from EV_FONT_CONSTANTS)

    	weight_thin: INTEGER_32 is 6
    			-- (from EV_FONT_CONSTANTS)

    feature -- Contract support

    	valid_family (a_family: INTEGER_32): BOOLEAN
    			-- Is `a_family' a valid family value.
    			-- (from EV_FONT_CONSTANTS)

    	valid_shape (a_shape: INTEGER_32): BOOLEAN
    			-- Is `a_shape' a valid shape value.
    			-- (from EV_FONT_CONSTANTS)

    	valid_weight (a_weight: INTEGER_32): BOOLEAN
    			-- Is `a_weight' a valid weight value.
    			-- (from EV_FONT_CONSTANTS)

    feature -- Output

    	io: STD_FILES
    			-- Handle to standard file setup
    			-- (from ANY)

    	out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of tagged_out.
    			-- (from ANY)

    	print (some: ANY)
    			-- Write terse external representation of `some'
    			-- on standard output.
    			-- (from ANY)

    	frozen tagged_out: STRING_8
    			-- New string containing terse printable representation
    			-- of current object
    			-- Was declared in ANY as synonym of out.
    			-- (from ANY)

    feature -- Platform

    	operating_environment: OPERATING_ENVIRONMENT
    			-- Objects available from the operating system
    			-- (from ANY)

    invariant
    	family_valid: is_initialized implies valid_family (family)
    	weight_valid: is_initialized implies valid_weight (weight)
    	shape_valid: is_initialized implies valid_shape (shape)
    	height_bigger_than_zero: is_initialized implies height > 0
    	ascent_not_negative: is_initialized implies ascent >= 0
    	descent_not_negative: is_initialized implies descent >= 0
    	width_of_empty_string_equals_zero: is_initialized implies string_width ("") = 0

    		-- from EV_ANY_I
    	interface_coupled: is_usable implies interface /= Void and then interface.implementation = Current
    	base_make_called: base_make_called

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

    indexing
    	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
    	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
    	source: "[
    		Eiffel Software
    		356 Storke Road, Goleta, CA 93117 USA
    		Telephone 805-685-1006, Fax 805-685-6869
    		Website http://www.eiffel.com
    		Customer support http://support.eiffel.com
    	]"

    end -- class EV_FONT_I