Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.video.font

Class EM_STANDARD_TTF_FONTS


Direct ancestors

KL_SHARED_EXECUTION_ENVIRONMENT, KL_SHARED_FILE_SYSTEM

Creation

Features

Invariants

indexing

description

Collection of True Type Fonts

date

$Date: 2005/10/23 10:59:04 $

revision

$Revision: 1.7 $

class

EM_STANDARD_TTF_FONTS

create {EM_SHARED_STANDARD_FONTS}

make

-- Create standard ttf font object.

feature -- Access

bitstream_vera_sans_font (point_size: INTEGER; style: INTEGER): EM_TTF_FONT

-- Bistream font with point_size size

require
point_size_positive: point_size > 0
style_valid: style = Normal or style = Bold or style = Italic or style = Bold | Italic
ensure
bitstream_vera_sans_font_not_void: Result /= Void
bitstream_vera_sans_fonts: HASH_TABLE [EM_TTF_FONT, INTEGER]

-- Bitstream font table

ensure
bitstream_vera_sans_fonts_not_void: Result /= Void
bitstream_vera_sans_mono_font (point_size: INTEGER; style: INTEGER): EM_TTF_FONT

-- bistream font with point_size size

require
point_size_positive: point_size > 0
style_valid: style = Normal or style = Bold or style = Italic or style = Bold | Italic
ensure
bitstream_vera_sans_mono_font_not_void: Result /= Void
bitstream_vera_sans_mono_fonts: HASH_TABLE [EM_TTF_FONT, INTEGER]

-- bitstream font table

ensure
bitstream_vera_sans_mono_fonts_not_void: Result /= Void
custom_fonts: HASH_TABLE [EM_TTF_FONT, STRING]

-- store custom fonts

ensure
custom_fonts_not_void: Result /= Void

feature -- Status report

font_dirname: STRING

-- Name of font directory; If not specified via set_font_dirname defaults to:
-- "${EM}/resource/font/ttf/bitstream" if the environment variable ${EM} is set
-- "." (current working directory) otherwise.

has_custom_font (id: STRING): BOOLEAN

-- Does the font identified by id exist?

require
id_not_void: id /= Void

feature -- Status setting

set_font_dirname (a_dirname: STRING)

-- Set font_dirname to a_dirname.

require
a_dirname_not_void: a_dirname /= Void
ensure
font_dirname_set: font_dirname = a_dirname

feature -- Custom fonts

custom_font (id: STRING): EM_TTF_FONT

-- Custom font identified by id
-- The result always exists! If id is unknown this feature returns 'bitstream_vera_sans (12)'.

require
id_not_void: id /= Void
ensure
custom_font_not_void: Result /= Void
load_custom_font (ttf_file: STRING; point_size: INTEGER; id: STRING)

-- Load a font from ttf_file with point_size size and store it as id

require
ttf_file_not_void: ttf_file /= Void
point_size_positive: point_size > 0
id_not_void: id /= Void
id_not_taken: not has_custom_font (id)
ensure
font_loaded: has_custom_font (id)

feature -- Style for Bitstream

bold: INTEGER
italic: INTEGER
normal: INTEGER

feature -- Standard Fonts

bitstream_vera_sans (point_size: INTEGER): EM_TTF_FONT

-- 'bistream vera sans' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_not_void: Result /= Void
bitstream_vera_sans_bold (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans bold' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_bold_not_void: Result /= Void
bitstream_vera_sans_bold_italic (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans bold italic' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_bold_italic_not_void: Result /= Void
bitstream_vera_sans_italic (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans italic' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_italic_not_void: Result /= Void
bitstream_vera_sans_mono (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans mono' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_mono_not_void: Result /= Void
bitstream_vera_sans_mono_bold (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans mono bold' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_mono_bold_not_void: Result /= Void
bitstream_vera_sans_mono_bold_italic (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans mono bold italic' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_mono_bold_italic_not_void: Result /= Void
bitstream_vera_sans_mono_italic (point_size: INTEGER): EM_TTF_FONT

-- 'bitstream vera sans mono italic' font

require
point_size_positive: point_size > 0
ensure
bitstream_vera_sans_mono_italic_not_void: Result /= Void

invariant


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

end