indexing description: "Objects that ..." author: "" date: "$Date$" revision: "$Revision$" class EM3D_FONT_FORMAT create make, make_with_color feature -- Initialization make (a_font: EM3D_FONT) is -- require font_exists: a_font /= Void do make_with_color (a_font, create {EM_COLOR}.make_white) end make_with_color (a_font: EM3D_FONT; a_color: EM_COLOR) is -- require font_exists: a_font /= Void color_exists: a_color /= Void do font := a_font color := a_color point_size := font.optimal_point_size use_point_snapping := False ensure set: font = a_font -- and color = a_color not_snapped: not use_point_snapping end feature -- Access font: EM3D_FONT -- point_size: DOUBLE -- color: EM_COLOR -- use_point_snapping: BOOLEAN -- Use only integral coordinates? -- Use this in conjunction with an ortographic projection -- to achieve very nice text rendering -- Disabled by default feature -- Measurement line_skip: DOUBLE is -- Line spacing do Result := font.line_skip (point_size) end ascent: DOUBLE is --Max ascent do Result := font.ascent (point_size) end descent: DOUBLE is -- Max descent do Result := font.descent (point_size) end baseline_offset: DOUBLE is -- Offset of baseline from top boundary do Result := font.baseline_offset (point_size) end char_width (a_chr: CHARACTER): DOUBLE is -- Width of `a_chr' in points do Result := font.char_width (a_chr, point_size) end string_width (a_string: STRING): DOUBLE is -- Width of `string' in points do Result := font.string_width (a_string, point_size) end string_height (a_string: STRING): DOUBLE is -- Height of `string' in points do Result := font.string_height (a_string, point_size) end feature -- Status report feature -- Status setting feature -- Cursor movement feature -- Element change override_point_size (a_point_size: DOUBLE) is -- do point_size := a_point_size ensure set: point_size = a_point_size end use_optimal_point_size is -- do point_size := font.optimal_point_size ensure set: point_size = font.optimal_point_size end set_font (a_font: EM3D_FONT) is -- require font_exits: a_font /= Void do font := a_font ensure set: font = a_font end set_color (a_color: EM_COLOR) is -- require color_exists: a_color /= Void do color := a_color ensure set: color = a_color end enable_point_snapping is -- do use_point_snapping := True ensure enabled: use_point_snapping end disable_point_snapping is -- do use_point_snapping := False ensure disabled: not use_point_snapping end feature -- Removal feature -- Resizing feature -- Transformation feature -- Conversion feature -- Duplication feature -- Miscellaneous feature -- Basic operations feature -- Obsolete feature -- Rendering feature {NONE} -- Implementation invariant font_exists: font /= Void end