class HexaPDF::Font::Type1::FontMetrics

Parent

Represents the information stored in an AFM font metrics file for a Type1 font that is needed for working with that font in context of the PDF format.

Attributes

ascender[RW]

Ascender of the font.

bounding_box[RW]

The font bounding box as array of four numbers, specifying the x- and y-coordinates of the bottom left corner and the x- and y-coordinates of the top right corner.

cap_height[RW]

The y-value of the top of the capital H (or 0 or nil if the font doesn’t contain a capital H).

character_metrics[RW]

Mapping of character codes and names to CharacterMetrics objects.

character_set[RW]

A string describing the character set of the font.

descender[RW]

Descender of the font.

dominant_horizontal_stem_width[RW]

Dominant width of horizontal stems.

dominant_vertical_stem_width[RW]

Dominant width of vertical stems.

encoding_scheme[RW]

A string indicating the default encoding used for the font.

family_name[RW]

Name of the typeface family to which the font belongs.

font_name[RW]

PostScript name of the font.

full_name[RW]

Full text name of the font.

is_fixed_pitch[RW]

Boolean specifying if the font is a fixed pitch (monospaced) font.

italic_angle[RW]

Angle (in degrees counter-clockwise from the vertical) of the dominant vertical strokes of the font.

kerning_pairs[RW]

Nested mapping of kerning pairs, ie. each key is a character name and each value is a mapping from the second character name to the kerning amount.

ligature_pairs[RW]

Nested mapping of ligature pairs, ie. each key is a character name and each value is a mapping from the second character name to the ligature name.

underline_position[RW]

Distance from the baseline for centering underlining strokes.

underline_thickness[RW]

Stroke width for underlining.

weight[RW]

A string describing the weight of the font.

x_height[RW]

The y-value of the top of the lowercase x (or 0 or nil if the font doesnt’ contain a lowercase x)

Public Instance Methods

weight_class()

Returns the weight of the font as a number.

The return value 0 is used if the weight class cannot be determined.