indexing
	description: "Defines the attributes of a font."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_LOG_FONT

create 

	make (a_height: INTEGER; a_face_name: STRING)
			-- Make a font with a_height as height and
			-- a_face_name as face_name.
		require
			a_face_name_not_void: a_face_name /= void
			valid_count: a_face_name.count <= max_face_name_length
		ensure
			height_set: height = a_height
			width_set: width = 0
			escapement_set: escapement = 0
			weight_set: weight = 0
			not_italic: not italic
			not_underlined: not underlined
			not_strike_out: not strike_out
			has_default_character_set: has_default_character_set
			has_default_clipping_precision: has_default_clipping_precision
			has_default_quality: has_default_quality
			has_default_pitch: has_default_pitch
			is_dont_care_family: is_dont_care_family
			face_name_set: face_name.is_equal (a_face_name)

	make_with_pointer (a_pointer: POINTER)
			-- Copy structure pointed by a_pointer in
			-- item.

	make_by_font (font: WEL_FONT)
			-- Make a log font using the information of font.
		require
			font_not_void: font /= void
			font_exists: font.exists

feature -- Access

	char_set: INTEGER
			-- Character set of current font

	clip_precision: INTEGER
			-- Clipping precision.
			-- Define how to clip characters that are
			-- partially outside clipping region.

	escapement: INTEGER
			-- Escapement of current font.
			-- The angle, in tenths of degrees, of each line of
			-- text written in the font (relative to the
			-- bottom of the page).

	face_name: STRING
			-- Face name of current font
		ensure
			result_exists: Result /= void

	family: INTEGER
			-- Family of current font

	height: INTEGER
			-- Height of current font.
			-- Specifies the height, in logical units, of the
			-- font. The font height can be specified in one of
			-- three ways. If height is greater than zero, it
			-- is transformed into device units and matched
			-- against the cell height of the available fonts. If
			-- it is zero, a reasonable default size is used. If
			-- it is less than zero, it is transformed into
			-- device units and the absolute value is matched
			-- against the character height of the available
			-- fonts.

	height_in_points: INTEGER
			-- Size of font in points (1 point = 1/72 of an inch)

	italic: BOOLEAN
			-- Is current font italic?

	item: POINTER
			-- Generic Windows handle or structure pointer.
			-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
			-- (from WEL_ANY)

	orientation: INTEGER
			-- Orientation of current font.
			-- The angle, in tenths of degrees, of each
			-- character's base line (relative to the bottom
			-- of the page).

	out_precision: INTEGER
			-- Output precision of current font.
			-- The output precision defines how closely the output
			-- must match the requested font's height, width,
			-- character orientation, escapement, and pitch.

	pitch: INTEGER
			-- Pitch of current font

	pitch_and_family: INTEGER
			-- Pitch and family of current font

	quality: INTEGER
			-- Quality of current font.
			-- Specifies the output quality. The output quality
			-- defines how carefully the graphics device interface
			-- (GDI) must attempt to match the logical-font
			-- attributes to those of an actual physical font.

	strike_out: BOOLEAN
			-- Is current font striked out?

	underlined: BOOLEAN
			-- Is current font underlined?

	weight: INTEGER
			-- Weight of current font.
			-- In the range 0 through 1000, for example,
			-- 400 is normal and 700 is bold).

	width: INTEGER
			-- Width of current font.
			-- Specifies the average width, in logical units, of
			-- characters in the font. If width is zero, the
			-- aspect ratio of the device is matched against the
			-- digitization aspect ratio of the available fonts to
			-- find the closest match, determined by the absolute
			-- value of the difference.
	
feature -- Measurement

	structure_size: INTEGER
			-- Size to allocate (in bytes)
		ensure -- from WEL_STRUCTURE
			positive_result: Result > 0
	
feature -- Status report

	exists: BOOLEAN
			-- Does the item exist?
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = (item /= default_pointer)

	has_ansi_character_set: BOOLEAN
			-- Has current font the ansi character set?

	has_character_clipping_precision: BOOLEAN
			-- Has current font the character clipping precision?

	has_character_output_precision: BOOLEAN
			-- Has current font the character output precision?

	has_default_character_set: BOOLEAN
			-- Has current font the default character set?

	has_default_clipping_precision: BOOLEAN
			-- Has current font the default clipping precision?

	has_default_output_precision: BOOLEAN
			-- Has current font the default output precision?

	has_default_pitch: BOOLEAN
			-- Has current font the default pitch?

	has_default_quality: BOOLEAN
			-- Has current font the default quality?

	has_draft_quality: BOOLEAN
			-- Has current font the draft quality?

	has_fixed_pitch: BOOLEAN
			-- Has current font the fixed pitch?

	has_oem_character_set: BOOLEAN
			-- Has current font the OEM character set?

	has_proof_quality: BOOLEAN
			-- Has current font the proof quality?

	has_string_output_precision: BOOLEAN
			-- Has current font the string output precision?

	has_stroke_clipping_precision: BOOLEAN
			-- Has current font the stroke clipping precision?

	has_stroke_output_precision: BOOLEAN
			-- Has current font the stroke output precision?

	has_symbol_character_set: BOOLEAN
			-- Has current font the symbol character set?

	has_unicode_character_set: BOOLEAN
			-- Has current font the unicode character set?

	has_variable_pitch: BOOLEAN
			-- Has current font the variable pitch?

	is_decorative_family: BOOLEAN
			-- Is current font in the decorative family?

	is_dont_care_family: BOOLEAN
			-- Is current font in the don t care family?

	is_modern_family: BOOLEAN
			-- Is current font in the modern family?

	is_roman_family: BOOLEAN
			-- Is current font in the roman family?

	is_script_family: BOOLEAN
			-- Is current font in the script family?

	is_swiss_family: BOOLEAN
			-- Is current font in the swiss family?

	shared: BOOLEAN
			-- Is item shared by another object?
			-- If False (by default), item will
			-- be destroyed by destroy_item.
			-- If True, item will not be destroyed.
			-- (from WEL_ANY)
	
feature -- Status setting

	max_face_name_length: INTEGER
			-- Maximum face name length

	set_ansi_character_set
			-- Set char_set to ansi.
		ensure
			has_ansi_character_set: has_ansi_character_set

	set_char_set (a_char_set: INTEGER)
			-- Set char_set to a_char_set.
		ensure
			char_set_set: char_set = a_char_set

	set_character_clipping_precision
			-- Set clip_precision to character clipping precision.
		ensure
			has_character_clipping_precision: has_character_clipping_precision

	set_character_output_precision
			-- Set out_precision to character precision.
		ensure
			has_character_output_precision: has_character_output_precision

	set_clip_precision (a_precision: INTEGER)
			-- Set clip_precision to a_precision.
		ensure
			clip_precision_set: clip_precision = a_precision

	set_decorative_family
			-- Set family to decorative family.
		ensure
			is_decorative_family: is_decorative_family

	set_default_character_set
			-- Set char_set to the default value.
		ensure
			has_default_character_set: has_default_character_set

	set_default_clipping_precision
			-- Set clip_precision to the default value.
		ensure
			has_default_clipping_precision: has_default_clipping_precision

	set_default_output_precision
			-- Set out_precision to default output precision.
		ensure
			has_default_output_precision: has_default_output_precision

	set_default_pitch
			-- Set pitch to the default value.
		ensure
			has_default_pitch: has_default_pitch

	set_default_quality
			-- Set quality to the default value.
		ensure
			has_default_quality: has_default_quality

	set_dont_care_family
			-- Set family to dont care family.
		ensure
			is_dont_care_family: is_dont_care_family

	set_draft_quality
			-- Set quality to the draft quality.
		ensure
			has_draft_quality: has_draft_quality

	set_escapement (a_escapement: INTEGER)
			-- Set escapement to a_escapement.
		ensure
			escapement_set: escapement = a_escapement

	set_face_name (a_face_name: STRING)
			-- Set face_name to a_face_name.
		require
			a_face_name_not_void: a_face_name /= void
			valid_count: a_face_name.count <= max_face_name_length
		ensure
			face_name_set: face_name.is_equal (a_face_name)

	set_family (a_family: INTEGER)
			-- Set family to a_family.
		ensure
			family_set: family = a_family

	set_fixed_pitch
			-- Set pitch to fixed pitch.
		ensure
			has_fixed_pitch: has_fixed_pitch

	set_height (a_height: INTEGER)
			-- Set height to a_height.
		ensure
			height_set: height = a_height

	set_italic
			-- Set current font italic.
		ensure
			italic: italic

	set_modern_family
			-- Set family to modern family.
		ensure
			is_modern_family: is_modern_family

	set_not_italic
			-- Set current font not italic.
		ensure
			not_italic: not italic

	set_not_strike_out
			-- Set current font not striked out.
		ensure
			not_strike_out: not strike_out

	set_not_underlined
			-- Set current font not underlined.
		ensure
			not_underlined: not underlined

	set_oem_character_set
			-- Set char_set to OEM.
		ensure
			has_oem_character_set: has_oem_character_set

	set_orientation (a_orientation: INTEGER)
			-- Set orientation to a_orientation.
		ensure
			orientation_set: orientation = a_orientation

	set_out_precision (a_precision: INTEGER)
			-- Set out_precision to a_out_precision.
		ensure
			out_precision_set: out_precision = a_precision

	set_pitch (a_pitch: INTEGER)
			-- Set pitch to a_pitch.
		ensure
			pitch_set: pitch = a_pitch

	set_pitch_and_family (a_pitch_and_family: INTEGER)
			-- Set pitch_and_family with a_pitch_and_family.
		ensure
			pitch_and_family_set: pitch_and_family = a_pitch_and_family

	set_proof_quality
			-- Set quality to the proof quality.
		ensure
			has_proof_quality: has_proof_quality

	set_quality (a_quality: INTEGER)
			-- Set quality to a_quality.
		ensure
			quality_set: quality = a_quality

	set_roman_family
			-- Set family to roman family.
		ensure
			is_roman_family: is_roman_family

	set_script_family
			-- Set family to script family.
		ensure
			is_script_family: is_script_family

	set_shared
			-- Set shared to True.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			shared: shared

	set_strike_out
			-- Set current font striked out.
		ensure
			strike_out: strike_out

	set_string_output_precision
			-- Set out_precision to string output precision.
		ensure
			has_string_output_precision: has_string_output_precision

	set_stroke_clipping_precision
			-- Set clip_precision to the storke clipping precision.
		ensure
			has_stroke_clipping_precision: has_stroke_clipping_precision

	set_stroke_output_precision
			-- Set out_precision to stroke output precision.
		ensure
			has_stroke_output_precision: has_stroke_output_precision

	set_swiss_family
			-- Set family to swiss family.
		ensure
			is_swiss_family: is_swiss_family

	set_symbol_character_set
			-- Set char_set to symbol.
		ensure
			has_symbol_character_set: has_symbol_character_set

	set_underlined
			-- Set current font underlined.
		ensure
			underlined: underlined

	set_unicode_character_set
			-- Set char_set to unicode.
		ensure
			has_unicode_character_set: has_unicode_character_set

	set_unshared
			-- Set shared to False.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			unshared: not shared

	set_variable_pitch
			-- Set pitch to variable pitch.
		ensure
			has_variable_pitch: has_variable_pitch

	set_weight (a_weight: INTEGER)
			-- Set weight to a_weight.
		ensure
			weight_set: weight = a_weight

	set_width (a_width: INTEGER)
			-- Set width to a_width.
		ensure
			width_set: width = a_width
	
feature -- Element change

	set_item (an_item: POINTER)
			-- Set item with an_item
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = an_item
	
feature -- Removal

	dispose
			-- Destroy the inner structure of Current.
			--
			-- This function should be called by the GC when the
			-- object is collected or by the user if Current is
			-- no more usefull.
			-- (from WEL_ANY)
	
feature -- Conversion

	to_integer: INTEGER
			-- Converts item to an integer.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = cwel_pointer_to_integer (item)
	
feature -- Basic operations

	initialize
			-- Fill Current with zeros.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	initialize_with_character (a_character: CHARACTER)
			-- Fill current with a_character.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	memory_copy (source_pointer: POINTER; length: INTEGER)
			-- Copy length bytes from source_pointer to item.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			length_small_enough: length <= structure_size
			length_large_enough: length > 0
			exists: exists
	
feature -- Re-initialisation

	update_by_font (font: WEL_FONT)
			-- Update object attributes using the information of font.
		require
			font_not_void: font /= void
			font_exists: font.exists
	
invariant

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

end -- class WEL_LOG_FONT