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 the text overlay horizontally, vertically, or both.

  • 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 of the text overlay.

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

    Specifies the padding around the overlaid text.

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

    Specifies the corner radius of the text overlay.

  • 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 111

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 the text overlay horizontally, vertically, or both.



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

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)


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

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)


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

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)


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

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.



55
56
57
# File 'lib/imagekitio/models/text_overlay_transformation.rb', line 55

optional :inner_alignment,
enum: -> { Imagekitio::TextOverlayTransformation::InnerAlignment },
api_name: :innerAlignment

#line_heightFloat, ...

Specifies the line height of the text overlay. Accepts integer values representing line height in points. It can also accept [arithmetic expressions](imagekit.io/docs/arithmetic-expressions-in-transformations) such as ‘bw_mul_0.2`, or `bh_div_20`.

Returns:

  • (Float, String, nil)


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

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)


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

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

#radiusFloat, ...

Specifies the corner radius of the text overlay. Set to ‘max` to achieve a circular or oval shape.

Returns:

  • (Float, Symbol, :max, nil)


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

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)


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

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)


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

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)


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

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

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

.variantsArray(Float, String)

Returns:

  • (Array(Float, String))


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