class interface LOGICAL_FONT
creation
make
from_string (str: STRING)
-- Init object from string.
require
valid: str /= Void
ensure
done: -- success implies to_string.is_equal(str)
feature(s) from P_TEXT_OBJECT
-- Public interface
to_string: STRING
ensure
is_copy: Result /= Void
from_string (str: STRING)
-- Init object from string.
require
valid: str /= Void
ensure
done: -- success implies to_string.is_equal(str)
feature(s) from LOGICAL_FONT
-- Copy/Equality
copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
require
other_not_void: other /= Void
ensure
is_equal: is_equal(other)
is_equal (other: like Current): BOOLEAN
-- Is other attached to an object considered equal to
-- current object ?
require
other_not_void: other /= Void
ensure
consistent: standard_is_equal(other) implies Result;
symmetric: Result implies other.is_equal(Current)
feature(s) from LOGICAL_FONT
-- Typeface name
is_default_face: BOOLEAN
-- Is the current typeface the default?
face_name: STRING
-- Get the current face name.
require
exist: not is_default_face
ensure
is_copy: Result /= Void
set_face_name (str: STRING)
-- Set required typeface name (may be an empty string).
require
valid_string: str /= Void
ensure
done: not is_default_face
reset_face_name
-- Use default typeface.
ensure
done: is_default_face
feature(s) from LOGICAL_FONT
-- Height (Points)
is_point: BOOLEAN
-- Is the current height the point value?
is_cell_height: BOOLEAN
-- Is the current height the character cell height?
is_character_height: BOOLEAN
-- Is the current height the character height?
is_default_height: BOOLEAN
-- Is the current height the default height?
height_value: INTEGER
-- Height (semantics depending on is_point, etc).
require
meaningful: not is_default_height
ensure
valid: Result >= 0
set_point (h: INTEGER)
-- Set the character height in points.
require
valid_height: h > 0;
no_width: is_default_width
ensure
done: is_point and not is_default_height and not is_character_height and not is_cell_height
set_cell_height (h: INTEGER)
-- Set the required character cell height (in logical units).
require
valid_height: h > 0
ensure
done: is_cell_height and not is_default_height and not is_character_height and not is_point
set_character_height (h: INTEGER)
-- Set the required character height (in logical units).
require
valid_height: h > 0
ensure
done: is_character_height and not is_cell_height and not is_default_height and not is_point
reset_height
-- Use default height.
ensure
done: is_default_height and not is_cell_height and not is_point and not is_character_height
feature(s) from LOGICAL_FONT
-- Style
reset_style
-- Reset style to normal.
is_italic: BOOLEAN
-- Is italic?
set_italic
-- Use italics.
ensure
done: is_italic
reset_italic
-- Do not use italics.
ensure
done: not is_italic
is_underline: BOOLEAN
-- Is underlined?
set_underline
-- Underline.
ensure
done: is_underline
reset_underline
-- Do not underline.
ensure
done: not is_underline
feature(s) from LOGICAL_FONT
-- Standard weight constants.
Thin: INTEGER
Extra_light: INTEGER
Light: INTEGER
Normal: INTEGER
Medium: INTEGER
Semi_bold: INTEGER
Bold: INTEGER
Extra_bold: INTEGER
Heavy: INTEGER
feature(s) from LOGICAL_FONT
-- Weight (point)
weight: INTEGER
-- Current weight.
is_default_weight: BOOLEAN
-- Is current weight the default?
set_weight (value: INTEGER)
-- Set weight (1-1000).
require
valid_weight: value > 0 and value <= 1000
reset_weight
-- Use default weight.
feature(s) from LOGICAL_FONT
-- Line orientation
line_orientation: INTEGER
-- Get line orientation angle.
set_line_orientation (angle: INTEGER)
-- Line orientation, 10th of degree, x-axis, anticlockwise.
feature(s) from LOGICAL_FONT
-- (Extended) Character orientation
character_orientation: INTEGER
-- Get character orientation.
set_character_orientation (angle: INTEGER)
-- Individual character orientation, 10th of degree, x-axis,
-- anticlockwise.
feature(s) from LOGICAL_FONT
-- (Extended) Width
width: INTEGER
-- Get current width.
is_default_width: BOOLEAN
-- Is default width?
reset_width
-- Font width optimised from optimal aspect ratio.
ensure
done: is_default_width
set_width (w: INTEGER)
-- Set required width of font.
require
valid_width: w > 0
ensure
done: not is_default_width
feature(s) from LOGICAL_FONT
-- (Extended) strike out
is_strike_out: BOOLEAN
-- Is text struck out?
set_strike_out
-- Enable strike out.
ensure
done: is_strike_out
reset_strike_out
-- Disable strike out.
ensure
done: not is_strike_out
feature(s) from LOGICAL_FONT
-- (Extended) Pitch
is_pitch_fixed: BOOLEAN
-- Fixed-size font?
is_pitch_unknown: BOOLEAN
-- Unknown pitch?
is_pitch_variable: BOOLEAN
-- Proportional font?
reset_pitch
ensure
done: is_pitch_unknown
set_pitch_fixed
ensure
done: is_pitch_fixed
set_pitch_variable
ensure
done: is_pitch_variable
feature(s) from LOGICAL_FONT
-- (Extended) Font family
is_family_unknown: BOOLEAN
-- Font family is not known.
is_family_decorative: BOOLEAN
-- Decorative: novelty font such as old english.
is_family_swiss: BOOLEAN
-- Swiss: proportional and sans-serif.
is_family_roman: BOOLEAN
-- Roman: proportional and serif (classic font such as Times).
is_family_modern: BOOLEAN
-- Modern: fixed-pitch (such as Courier).
is_family_script: BOOLEAN
-- Script: handwriting like.
reset_family
-- No family preference.
ensure
done: is_family_unknown
set_family_decorative
ensure
done: is_family_decorative
set_family_swiss
ensure
done: is_family_swiss
set_family_roman
ensure
done: is_family_roman
set_family_modern
ensure
done: is_family_modern
set_family_script
ensure
done: is_family_script
feature(s) from LOGICAL_FONT
-- (Extended) charset
is_charset_ansi: BOOLEAN
-- Is font using ANSI (ISO Latin-1) character set?
is_charset_default: BOOLEAN
-- No specified character set.
is_charset_symbol: BOOLEAN
-- Symbol font?
is_charset_oem: BOOLEAN
-- Is OEM (usually PC437) character set?
reset_charset
-- Use Windows' ANSI (Latin-1) or Unicode charset.
ensure
done: is_charset_ansi
set_charset_ansi
-- Use Windows' ANSI (Latin-1) or Unicode charset.
ensure
done: is_charset_ansi
set_charset_default
-- Use default charset.
ensure
done: is_charset_default
set_charset_symbol
-- Use symbol charset.
ensure
done: is_charset_symbol
set_charset_oem
-- Use OEM (device dependent) charset
ensure
done: is_charset_oem
invariant
init: struct /= Void;
end of LOGICAL_FONT