Automaticaly size l_text font

Options
anyyate
anyyate Member Posts: 1
edited April 2023 in Developer APIs

Hi, is there an option to automatically resize the text font?

For example, if given l_text is too long, it should fit into the canvas. If l_text is short, increase the font size as much as possible.

My goal is to fit a given random text into a square image as well as possible.

Answers

  • Akshay_joshi
    Akshay_joshi Administrator, Cloudinary Staff Posts: 6
    Options

    Hi there,

    Currently, there isn't a way to automatically downsize the font size based on the input length of the number of lines, or a way to determine if the text overflows the text box dimensions.

    I think that the best way to achieve what you are looking for is via the code itself because we do have conditional transformation, but the conditions are applied to the image feature, and not to the transformations themselves. The same is for user-defined variables.

    Regards,

    Akshay