# \[BUG\]Grouped Labels with Font Binding

**URL:** <https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 20, 2022, 5:48pm UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645 "2022-04-20T17:48:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 20, 2022, 5:48pm UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/1 "2022-04-20T17:48:45Z")

</div>

I have bindings on the font property of multiple labels for different sizes and styles (italic, bold, etc.). However, when I group multiple labels together they all end up with the same font style, despite having different individual properties. Attempting to re-bind the properties does nothing.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [April 20, 2022, 6:09pm UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/2 "2022-04-20T18:09:15Z")

</div>

I don’t think this is a bug. Most likely this is intended design. Any software I have used for pretty much anything works this way.

Consider grouped items as a way to select multiple things.

Not sure why you need to group them?

If multiple items are selected and you change something it effects everything selected, not just one item.

So i’m assuming it is causing conflict per intention.

I don’t see a huge need to actually group, for design purposes you can select multiple items for moving around. I’d only group if i intended to impose the same thing on all grouped “selected” items.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 20, 2022, 10:16pm UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/3 "2022-04-20T22:16:58Z")

</div>

Can you show exactly what you mean by ‘font binding’? You can’t directly attach a binding to a font property, at least on a standard label component.

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [April 21, 2022, 12:25am UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/4 "2022-04-21T00:25:15Z")

</div>

A Container public style could be useful. I mean, configure a group of style first, then every components in that container get the styles.  
Sometimes,we need to configure styles many times.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 21, 2022, 1:51am UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/5 "2022-04-21T01:51:26Z")

</div>

I have a binding directly to a font on EVERY label in my project so I can update all text font in an instant at the client’s request. To get it to work I temporarily bind to a different text property until the format string matches the format that I want, and then right-click copy binding and right-click paste binding on the font property. It works for me.

For instance `concat({[default]Styles/textFont},", Plain, 18")`

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [April 21, 2022, 1:53am UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/6 "2022-04-21T01:53:09Z")

</div>

That seems silly. I should be able to group any independent objects any way I like and it the properties of every object should be unchanged.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2022, 2:29pm UTC](https://forum.inductiveautomation.com/t/bug-grouped-labels-with-font-binding/58645/7 "2022-04-21T14:29:56Z")

</div>

> [@amarks](#):
>
> To get it to work I temporarily bind to a different text property until the format string matches the format that I want, and then right-click copy binding and right-click paste binding on the font property. It works for me.

I mean... so the actual issue here is that _you're allowed to do that_, not what happens on grouping. You've essentially discovered undefined behavior - it happens to work, until we do the grouping operation and recreate the components, at which point your manually injected bindings happen to disappear.

What I would do to accomplish the same goal, but faster (for you as a developer) is use a script to recursively walk the component tree and change every label component's font at once.

Starting from the code I posted here:

> [@Upgrade version makes buttons dissapear (possible bug?)](https://forum.inductiveautomation.com/t/upgrade-version-makes-buttons-dissapear-possible-bug/54921/14):
>
> For anyone finding/being linked to this thread in the future; if you want a ‘middle ground’ solution between a global UI manager key and setting every button up with scripting, you could use a technique like this to recursively modify every button in the window (e.g. in visionWindowOpened): from javax.swing import AbstractButton from com.inductiveautomation.ignition.client.IgnitionLookAndFeel import setBlendMode from de.javasoft.plaf.synthetica.util.Synthetica2DUtils import BlendMode def getCo…

You just need a different filter function:

```python
from com.inductiveautomation.factorypmi.application.components import PMILabel
isLabel = lambda component: isinstance(component, PMILabel)

```

And then your modification is as simple as setting the font:

```python
from java.awt import Font
win = system.gui.getWindow("yourWindow")
for label in filter(isLabel, getComponents(win)):
	label.font = Font("name", Font.PLAIN, 18)

```
