class HexaPDF::Font::Type1::Font

Parent
Extended With

Represents a Type1 font.

This class abstracts from the specifics of the Type1 font and allows working with it in a standardized way.

The following method calls are forwarded to the contained FontMetrics object:

  • font_name

  • full_name

  • family_name

  • weight

  • weight_class

  • font_bbox

  • italic_angle

  • ascender

  • descender

  • cap_height

  • x_height

  • horizontal_dominant_width

  • vertical_dominant_width

Attributes

metrics[R]

The associated FontMetrics object.

Public Class Methods

from_afm(source)

Creates a Type1 font object from an AFM source.

new(metrics)

Creates a new Type1 font object with the given font metrics.

Public Instance Methods

encoding()

Returns the built-in encoding of the font.

features()

Returns a set of features this font supports.

For Type1 fonts, the features that may be available :kern and :liga.

missing_glyph_id()

Returns the name/id of the missing glyph, i.e. .notdef.

strikeout_position()

Returns the distance from the baseline to the top of the strikeout line.

strikeout_thickness()

Returns the thickness of the strikeout line.

underline_position()

Returns the distance from the baseline to the top of the underline.

width(glyph_name) → width or nil
width(glyph_code) → width or nil

Returns the width of the glyph which can either be specified by glyph name or by an integer that is interpreted according to the built-in encoding.

If there is no glyph found for the name or code, nil is returned.