module HexaPDF::Content::TextRenderingMode
Defines all available text rendering modes as constants. Each text rendering mode is an instance of NamedValue
. For use with Content::GraphicsState#text_rendering_mode
.
See: PDF1.7 s9.3.6
Constants
- CLIP
Add text to path for clipping
- FILL
Fill text
- FILL_CLIP
Fill text and add to path for clipping
- FILL_STROKE
Fill, then stroke text
- FILL_STROKE_CLIP
Fill, then stroke text and add to path for clipping
- INVISIBLE
Neither fill nor stroke text (invisible)
- STROKE
Stroke text
- STROKE_CLIP
Stroke text and add to path for clipping
Public Class Methods
Returns the argument normalized to a valid text rendering mode.
-
0 or
:fill
can be used for theFILL
mode. -
1 or
:stroke
can be used for theSTROKE
mode. -
2 or
:fill_stroke
can be used for theFILL_STROKE
mode. -
3 or
:invisible
can be used for theINVISIBLE
mode. -
4 or
:fill_clip
can be used for theFILL_CLIP
mode. -
5 or
:stroke_clip
can be used for theSTROKE_CLIP
mode. -
6 or
:fill_stroke_clip
can be used for theFILL_STROKE_CLIP
mode. -
7 or
:clip
can be used for theCLIP
mode. -
Otherwise an error is raised.
# File lib/hexapdf/content/graphics_state.rb, line 259 def self.normalize(style) case style when :fill, 0 then FILL when :stroke, 1 then STROKE when :fill_stroke, 2 then FILL_STROKE when :invisible, 3 then INVISIBLE when :fill_clip, 4 then FILL_CLIP when :stroke_clip, 5 then STROKE_CLIP when :fill_stroke_clip, 6 then FILL_STROKE_CLIP when :clip, 7 then CLIP else raise ArgumentError, "Unknown text rendering mode: #{style}" end end