Start of trail qc_get_font_glyphs navigation bar

Table of Contents

qc_get_fonts

Gets information about the fonts installed on the system.

Syntax

fonts = qc_get_fonts(character_set, face_name)   % Get fonts in the given character set and with the specified face name.
fonts = qc_get_fonts(character_set)              % Get fonts in the given character set.
fonts = qc_get_fonts(face_name)                  % Get fonts with the specified face name.
fonts = qc_get_fonts                             % Get information about all the fonts on the system.
    

Description

Gets information about all the fonts on the system. The amount of information returned can be reduced by restricting the list to all the fonts in a given character set and/or belonging to a particular font face.

The returned structure array has three fields:

Field Name

Description

type

The type of font. It may be 'device', 'raster' or 'truetype'.

font

A structure defining the font, suitable for passing to qc_draw_text for drawing text on an image.

metrics

A structure providing more detailed information about the font metrics.

The fields of the font structure are:

Field Name

Description

height

The height of the font in pixels.

width

The width of the font in pixels.

escapement

The escapement angle in degrees (may be fractional).

orientation

The orientation angle in degrees (may be fractional).

weight

The font weight (1.0 = normal, smaller is thinner, larger is bolder, 1.75 is standard bold, 2.5 is maximum weight).

italic

Whether the font is italic (true or false).

underline

Whether the font is underlined (true or false).

strikeout

Whether the font is struck out (true or false).

character_set

A string indicating the character set to which the font belongs. Possible values are: 'default', 'ansi', 'baltic', 'chinesebig5', 'easteurope', 'gb2312', 'greek', 'hangul', 'mac', 'oem', 'russian', 'shiftjis', 'symbol', 'turkish', 'vietnamese', 'johab', 'arabic', 'hebrew', 'thai'.

output_precision

A string indicating the output precision. Possible values are: 'default', 'character', 'device', 'outline', 'postscript_only', 'raster', 'string', 'stroke', 'truetype_only', 'truetype'.

clip_precision

A string indicating the clip precision. Possible values are: 'default', 'character', 'stroke'.

quality

A string indicating the quality. Possible values are: 'antialiased', 'cleartype', 'default', 'draft', 'nonantialiased', 'proof'.

pitch

A string indicating the pitch. Possible values are: 'default', 'fixed', 'variable'.

family

A string indicating the family. Possible values are: 'decorative', 'dontcare', 'modern', 'script', 'swiss'.

face

A string containing the name of the font face e.g. 'Times New Roman'.

The fields of the metrics structure are:

Field Name

Description

height

The height of characters (ascent + descent).

ascent

The ascent of characters i.e. units above the baseline.

descent

The descent of characters i.e. units below the baseline.

internal_leading

The amount of leading or space inside the bounds of the character height where accents and other diacritical marks may occur.

external_leading

The amount of extra leading or space to add between rows. This area is outside the character cell so nothing is drawn in this area.

average_character_width

The average width of characters in the font, which is generally the width of the character 'x'. It does not include extra width for bold or italic characters.

maximum_character_width

The maximum width of a character in the font.

weight

The weight of the font.

overhang

The extra width per string that may be added for some synthesized fonts, such as bold or italic fonts that are synthesized.

digitized_aspect_x

The horizontal aspect of the device on which the font was designed.

digitized_aspect_y

The vertical aspect of the device on which the font was designed.

first_character

The value of the first character defined in the font.

last_character

The value of the last character defined in the font.

default_character

The character to use when a character is not defined in the font.

break_character

The character to use when defining word breaks for text justification.

italic

Whether the font is italic (true) or not (false).

underlined

Whether the font is underlined (true) or not (false).

struck_out

Whether the font is struck out (true) or not (false).

pitch

A cell array of strings defining the pitch of the font. Possible values are:

'device'

=

the font is a device font.

'truetype'

=

the font is a TrueType font.

'variable'

=

the font is variable pitch. If absent, the font is variable pitch.

'vector'

=

the font is a vector font.

family

A string indicating the font family. Possible values are: 'decorative', 'dontcare', 'modern', 'roman', 'script', 'swiss'.

character_set

A string indicating the character set to which the font belongs. Possible values are: 'default', 'ansi', 'baltic', 'chinesebig5', 'easteurope', 'gb2312', 'greek', 'hangul', 'mac', 'oem', 'russian', 'shiftjis', 'symbol', 'turkish', 'vietnamese', 'johab', 'arabic', 'hebrew', 'thai'.

Parameters

character_set

An optional string containing the name of the character set to which to restrict the retrieved fonts. Valid values are: 'default', 'ansi', 'baltic', 'chinesebig5', 'easteurope', 'gb2312', 'greek', 'hangul', 'mac', 'oem', 'russian', 'shiftjis', 'symbol', 'turkish', 'vietnamese', 'johab', 'arabic', 'hebrew', 'thai'

face_name

A string containing the name of the font face to which to restrict the list e.g. 'Arial'

Outputs

fonts

A structure array containing information about each font. See the description above for details.

Examples

fonts = qc_get_fonts('ansi'); % get all the fonts in the ANSI character set
    

See Also

 

navigation bar