module HexaPDF::Content::TextRenderingMode

Defines all available text rendering modes as constants. Each text rendering mode is an instance of NamedValue. For use with e.g. Canvas#text_rendering_mode.

See: PDF2.0 s9.3.6

Constants

CLIP

Add text to path for clipping.

Specify as 7 or :clip.

FILL

Fill text.

Specify as 0 or :fill.

FILL_CLIP

Fill text and add to path for clipping.

Specify as 4 or :fill_clip.

FILL_STROKE

Fill, then stroke text.

Specify as 2 or :fill_stroke.

FILL_STROKE_CLIP

Fill, then stroke text and add to path for clipping.

Specify as 6 or :fill_stroke_clip.

INVISIBLE

Neither fill nor stroke text (invisible).

Specify as 3 or :invisible.

STROKE

Stroke text.

Specify as 1 or :stroke.

STROKE_CLIP

Stroke text and add to path for clipping.

Specify as 5 or :stroke_clip.

Public Class Methods

normalize(style)

Returns the argument normalized to a valid text rendering mode, i.e. a NamedValue instance.

  • 0 or :fill can be used for the FILL mode.

  • 1 or :stroke can be used for the STROKE mode.

  • 2 or :fill_stroke can be used for the FILL_STROKE mode.

  • 3 or :invisible can be used for the INVISIBLE mode.

  • 4 or :fill_clip can be used for the FILL_CLIP mode.

  • 5 or :stroke_clip can be used for the STROKE_CLIP mode.

  • 6 or :fill_stroke_clip can be used for the FILL_STROKE_CLIP mode.

  • 7 or :clip can be used for the CLIP mode.

  • Otherwise an error is raised.