Class: Imagekitio::Models::TextOverlayTransformation
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Imagekitio::Models::TextOverlayTransformation
- Defined in:
- lib/imagekitio/models/text_overlay_transformation.rb
Defined Under Namespace
Modules: Flip, FontSize, InnerAlignment, LineHeight, Padding, Radius, Rotation, Width
Instance Attribute Summary collapse
-
#alpha ⇒ Float?
Specifies the transparency level of the text overlay.
-
#background ⇒ String?
Specifies the background color of the text overlay.
-
#flip ⇒ Symbol, ...
Flip/mirror the text horizontally, vertically, or in both directions.
-
#font_color ⇒ String?
Specifies the font color of the overlaid text.
-
#font_family ⇒ String?
Specifies the font family of the overlaid text.
-
#font_size ⇒ Float, ...
Specifies the font size of the overlaid text.
-
#inner_alignment ⇒ Symbol, ...
Specifies the inner alignment of the text when width is more than the text length.
-
#line_height ⇒ Float, ...
Specifies the line height for multi-line text overlays.
-
#padding ⇒ Float, ...
Specifies the padding around the overlaid text.
-
#radius ⇒ Float, ...
Specifies the corner radius:.
-
#rotation ⇒ Float, ...
Specifies the rotation angle of the text overlay.
-
#typography ⇒ String?
Specifies the typography style of the text.
-
#width ⇒ Float, ...
Specifies the maximum width (in pixels) of the overlaid text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(alpha: nil, background: nil, flip: nil, font_color: nil, font_family: nil, font_size: nil, inner_alignment: nil, line_height: nil, padding: nil, radius: nil, rotation: nil, typography: nil, width: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see TextOverlayTransformation for more details.
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(alpha: nil, background: nil, flip: nil, font_color: nil, font_family: nil, font_size: nil, inner_alignment: nil, line_height: nil, padding: nil, radius: nil, rotation: nil, typography: nil, width: nil) ⇒ Object
Some parameter documentations has been truncated, see Imagekitio::Models::TextOverlayTransformation for more details.
|
|
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 118
|
Instance Attribute Details
#alpha ⇒ Float?
Specifies the transparency level of the text overlay. Accepts integers from 1 to 9.
11 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 11 optional :alpha, Float |
#background ⇒ String?
Specifies the background color of the text overlay. Accepts an RGB hex code, an RGBA code, or a color name.
18 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 18 optional :background, String |
#flip ⇒ Symbol, ...
Flip/mirror the text horizontally, vertically, or in both directions. Acceptable values: h (horizontal), v (vertical), h_v (horizontal and vertical), or v_h.
26 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 26 optional :flip, enum: -> { Imagekitio::TextOverlayTransformation::Flip } |
#font_color ⇒ String?
Specifies the font color of the overlaid text. Accepts an RGB hex code (e.g., FF0000), an RGBA code (e.g., FFAABB50), or a color name.
33 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 33 optional :font_color, String, api_name: :fontColor |
#font_family ⇒ String?
Specifies the font family of the overlaid text. Choose from the supported fonts list or use a custom font. See [Supported fonts](imagekit.io/docs/add-overlays-on-images#supported-text-font-list) and [Custom font](imagekit.io/docs/add-overlays-on-images#change-font-family-in-text-overlay).
43 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 43 optional :font_family, String, api_name: :fontFamily |
#font_size ⇒ Float, ...
Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression.
50 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 50 optional :font_size, union: -> { Imagekitio::TextOverlayTransformation::FontSize }, api_name: :fontSize |
#inner_alignment ⇒ Symbol, ...
Specifies the inner alignment of the text when width is more than the text length.
57 58 59 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 57 optional :inner_alignment, enum: -> { Imagekitio::TextOverlayTransformation::InnerAlignment }, api_name: :innerAlignment |
#line_height ⇒ Float, ...
Specifies the line height for multi-line text overlays. It will come into effect only if the text wraps over multiple lines. Accepts either an integer value or an arithmetic expression.
67 68 69 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 67 optional :line_height, union: -> { Imagekitio::TextOverlayTransformation::LineHeight }, api_name: :lineHeight |
#padding ⇒ Float, ...
Specifies the padding around the overlaid text. Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). Arithmetic expressions are also accepted.
77 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 77 optional :padding, union: -> { Imagekitio::TextOverlayTransformation::Padding } |
#radius ⇒ Float, ...
Specifies the corner radius:
-
Single value (positive integer): Applied to all corners (e.g.,
20). -
max: Creates a circular or oval shape. -
Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
10_20_30_40). See [Radius](imagekit.io/docs/effects-and-enhancements#radius—r).
90 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 90 optional :radius, union: -> { Imagekitio::TextOverlayTransformation::Radius } |
#rotation ⇒ Float, ...
Specifies the rotation angle of the text overlay. Accepts a numeric value for clockwise rotation or a string prefixed with “N” for counter-clockwise rotation.
97 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 97 optional :rotation, union: -> { Imagekitio::TextOverlayTransformation::Rotation } |
#typography ⇒ String?
Specifies the typography style of the text. Supported values:
-
Single styles:
b(bold),i(italic),strikethrough. -
Combinations: Any combination separated by underscores, e.g.,
b_i,b_i_strikethrough.
107 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 107 optional :typography, String |
#width ⇒ Float, ...
Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., bw_mul_0.2 or bh_div_2) are supported. Useful when used in conjunction with the background. Learn about [Arithmetic expressions](imagekit.io/docs/arithmetic-expressions-in-transformations).
116 |
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 116 optional :width, union: -> { Imagekitio::TextOverlayTransformation::Width } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 161
|
.variants ⇒ Array(Float, String)
|
|
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 176
|