# ScaleText doesnt work properly

**URL:** <https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690>\
**Category:** General\
**Tags:** template, bug\
**Created:** [November 23, 2020, 10:33am UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690 "2020-11-23T10:33:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jillana](https://casparcgforum.org/user_avatar/casparcgforum.org/jillana/32/1431_2.png) [@jillana](https://casparcgforum.org/u/jillana)\
**Post date:** [November 23, 2020, 10:33am UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690/1 "2020-11-23T10:33:13Z")

</div>

I have a problem with a template, the text does not scale correctly, it is cut, but when I put one more character it adjusts to the object, it is just a question of a pixel, someone knows why ?

i show you my code and example

thanks

 ![animate](https://casparcgforum.org/uploads/default/original/2X/3/3724d209fcb18a1fb52a9f26dee4f7f03ee5839f.jpeg) ![code](https://casparcgforum.org/uploads/default/original/2X/c/cf6a07e9e7a6eb1b34ebf8d075c1172ef9b0225f.jpeg) ![code2](https://casparcgforum.org/uploads/default/original/2X/b/b1992b360cfdef4126c7e44db935e1bed47bcc37.jpeg) ![example](https://casparcgforum.org/uploads/default/original/2X/e/ea4f0224bbf5fbfeaf2529d2705f533f4264a135.jpeg) ![example2](https://casparcgforum.org/uploads/default/original/2X/2/21f34c5426a2a8f6e066a1857274ccddb91ba64b.jpeg)

---

<div class="post-metadata">

**Author:** ![didikunz](https://casparcgforum.org/user_avatar/casparcgforum.org/didikunz/32/7_2.png) [@didikunz](https://casparcgforum.org/u/didikunz)\
**Post date:** [November 23, 2020, 10:41am UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690/2 "2020-11-23T10:41:47Z")

</div>

It looks like some kind of rounding error. Do you use an embedded font? Are these “phase1” to “phase4” fields al located at -438? From the first picture it looks to me, that there is only one field at that same spot.

---

<div class="post-metadata">

**Author:** ![jillana](https://casparcgforum.org/user_avatar/casparcgforum.org/jillana/32/1431_2.png) [@jillana](https://casparcgforum.org/u/jillana)\
**Post date:** [November 23, 2020, 11:03am UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690/3 "2020-11-23T11:03:04Z")

</div>

yes it looks like rounding error is some code that i can add to the AS3 for this case, something like this ?

 ![test](https://casparcgforum.org/uploads/default/original/2X/1/1f9ebdbd06cab3cc1cba14640bda38e13dbf6853.jpeg)

---

<div class="post-metadata">

**Author:** ![didikunz](https://casparcgforum.org/user_avatar/casparcgforum.org/didikunz/32/7_2.png) [@didikunz](https://casparcgforum.org/u/didikunz)\
**Post date:** [November 23, 2020, 11:08am UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690/4 "2020-11-23T11:08:00Z")

</div>

You can try that. Sometimes it also helps to append a space " " to the end of the text to be set, before sending it to the ScaleDownTextField function, like:

`ScaleDownTextField(element.data.@value.toString() + " ", Barra_Main.phase1, 533, -438, 0);`

---

<div class="post-metadata">

**Author:** ![jillana](https://casparcgforum.org/user_avatar/casparcgforum.org/jillana/32/1431_2.png) [@jillana](https://casparcgforum.org/u/jillana)\
**Post date:** [November 23, 2020, 11:48am UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690/5 "2020-11-23T11:48:07Z")

</div>

yes, that work perfect thanks so much !!! but i put the + " " on the input right here and is work as well ![input](https://casparcgforum.org/uploads/default/original/2X/e/ee86b070dc404911924e47daec5139ddaede3c93.jpeg)

---

<div class="post-metadata">

**Author:** ![didikunz](https://casparcgforum.org/user_avatar/casparcgforum.org/didikunz/32/7_2.png) [@didikunz](https://casparcgforum.org/u/didikunz)\
**Post date:** [November 23, 2020, 12:07pm UTC](https://casparcgforum.org/t/scaletext-doesnt-work-properly/3690/6 "2020-11-23T12:07:55Z")

</div>

As I usually have the ScaleDownTextField function somewhere in a library I do it in the code case by case. Otherwise, if you use the library function or just copy the function to another template, you will run into troubles, as it is not always necessary to add the space. That depends on the used font. But sure, it works either way.
