Class: Imagekitio::Models::TextOverlayTransformation

Inherits:
Internal::Type::BaseModel show all
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

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • alpha (Float) (defaults to: nil)

    Specifies the transparency level of the text overlay. Accepts integers from 1

  • background (String) (defaults to: nil)

    Specifies the background color of the text overlay.

  • flip (Symbol, Imagekitio::Models::TextOverlayTransformation::Flip) (defaults to: nil)

    Flip/mirror the text horizontally, vertically, or in both directions.

  • font_color (String) (defaults to: nil)

    Specifies the font color of the overlaid text. Accepts an RGB hex code (e.g., ‘F

  • font_family (String) (defaults to: nil)

    Specifies the font family of the overlaid text. Choose from the supported fonts

  • font_size (Float, String) (defaults to: nil)

    Specifies the font size of the overlaid text. Accepts a numeric value or an arit

  • inner_alignment (Symbol, Imagekitio::Models::TextOverlayTransformation::InnerAlignment) (defaults to: nil)

    Specifies the inner alignment of the text when width is more than the text lengt

  • line_height (Float, String) (defaults to: nil)

    Specifies the line height for multi-line text overlays. It will come into effect

  • padding (Float, String) (defaults to: nil)

    Specifies the padding around the overlaid text.

  • radius (Float, Symbol, :max, String) (defaults to: nil)

    Specifies the corner radius:

  • rotation (Float, String) (defaults to: nil)

    Specifies the rotation angle of the text overlay.

  • typography (String) (defaults to: nil)

    Specifies the typography style of the text.

  • width (Float, String) (defaults to: nil)

    Specifies the maximum width (in pixels) of the overlaid text. The text wraps aut



# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 118

Instance Attribute Details

#alphaFloat?

Specifies the transparency level of the text overlay. Accepts integers from 1 to 9.

Returns:

  • (Float, nil)


11
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 11

optional :alpha, Float

#backgroundString?

Specifies the background color of the text overlay. Accepts an RGB hex code, an RGBA code, or a color name.

Returns:

  • (String, nil)


18
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 18

optional :background, String

#flipSymbol, ...

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_colorString?

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.

Returns:

  • (String, nil)


33
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 33

optional :font_color, String, api_name: :fontColor

#font_familyString?

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).

Returns:

  • (String, nil)


43
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 43

optional :font_family, String, api_name: :fontFamily

#font_sizeFloat, ...

Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression.

Returns:

  • (Float, String, nil)


50
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 50

optional :font_size, union: -> { Imagekitio::TextOverlayTransformation::FontSize }, api_name: :fontSize

#inner_alignmentSymbol, ...

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_heightFloat, ...

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.

Returns:

  • (Float, String, nil)


67
68
69
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 67

optional :line_height,
union: -> { Imagekitio::TextOverlayTransformation::LineHeight },
api_name: :lineHeight

#paddingFloat, ...

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.

Returns:

  • (Float, String, nil)


77
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 77

optional :padding, union: -> { Imagekitio::TextOverlayTransformation::Padding }

#radiusFloat, ...

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).

Returns:

  • (Float, Symbol, :max, String, nil)


90
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 90

optional :radius, union: -> { Imagekitio::TextOverlayTransformation::Radius }

#rotationFloat, ...

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.

Returns:

  • (Float, String, nil)


97
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 97

optional :rotation, union: -> { Imagekitio::TextOverlayTransformation::Rotation }

#typographyString?

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.

Returns:

  • (String, nil)


107
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 107

optional :typography, String

#widthFloat, ...

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).

Returns:

  • (Float, String, nil)


116
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 116

optional :width, union: -> { Imagekitio::TextOverlayTransformation::Width }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 161

.variantsArray(Float, String)

Returns:

  • (Array(Float, String))


# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 176