TEXT DYNAMIZATION

Adapt text size

Documentation DCO Enabler -> ENABLER ADOBE ANIMATE CC -> Adapt text size

ADAPT TEXT SIZE

If you want to insert dynamic text into your ad, but this text may take more space than the space available for it, you can use the adaptText method.

The adaptText method allows you to reduce the font size of a given element, “10” being the minimum size accepted (for example).

The reduction factor optimizes the display of the text and adapts the font size according to the text field’s container.

In the case where all the text does not fit in the place reserved for it and its font size is 15px, then the method will reduce its font size to 10px.

Example:

ADventori.initData ( {"wording": "Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l\'imprimerie depuis les années 1500, quand un peintre anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte."});
ADventori.Display.setText(this.textField,ADventori.data.wording);
ADventori.Display.adaptText(this.textField,10,TextField Width,TextField Height);

Result :

Want to dynamize and adapt your text at the same time? The setAndAdaptText method is for you:

ADventori.initData({wording: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."});
ADventori.Display.setAndAdaptText(this.textField,ADventori.data.wording,15,TextField Width,TextField Height);

Result: