# Vertical text truncated

**URL:** <https://forum.inductiveautomation.com/t/vertical-text-truncated/7945>\
**Category:** Ignition\
**Created:** [February 3, 2014, 4:51pm UTC](https://forum.inductiveautomation.com/t/vertical-text-truncated/7945 "2014-02-03T16:51:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [February 3, 2014, 4:51pm UTC](https://forum.inductiveautomation.com/t/vertical-text-truncated/7945/1 "2014-02-03T16:51:08Z")

</div>

I would like to use vertical text with a label component,  
The width must be large enough, otherwise the text is truncated !  
Is there a workaround ?

[attachment=0]bug\_text.png[/attachment]

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [February 3, 2014, 5:23pm UTC](https://forum.inductiveautomation.com/t/vertical-text-truncated/7945/2 "2014-02-03T17:23:52Z")

</div>

Yes, this is a long-standing problem with the label that has to do with something deep in Swing that we’re stuck with.

As a workaround, you could use the paintable canvas to make your own vertical label if you wanted to. Simple create a paintable canvas, put a custom property called “text” on it, and paste this into it’s paint event code:

[code]from java.lang import Math  
from java.awt import RenderingHints

g = event.graphics  
g.setRenderingHint(RenderingHints.KEY\_ANTIALIASING, RenderingHints.VALUE\_ANTIALIAS\_ON);  
fm = g.getFontMetrics()

g.setColor(event.source.background)  
g.fillRect(0,0,event.width,event.height)

stringWidth = fm.stringWidth(event.source.text)  
g.setColor(event.source.foreground)  
g.rotate(-Math.PI/2)  
g.drawString(event.source.text,-stringWidth,fm.getHeight())[/code]

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [February 4, 2014, 9:50am UTC](https://forum.inductiveautomation.com/t/vertical-text-truncated/7945/3 "2014-02-04T09:50:48Z")

</div>

Thanks for the tips.  
A bit cumbersome but it works !  
 ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")

---

<div class="post-metadata">

**Author:** ![stevetperry](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stevetperry](https://forum.inductiveautomation.com/u/stevetperry)\
**Post date:** [March 19, 2021, 3:05am UTC](https://forum.inductiveautomation.com/t/vertical-text-truncated/7945/4 "2021-03-19T03:05:58Z")

</div>

@Carl.Gould It seems like this is still an issue in Ignition 8.1. Is there any hope of resolving this annoying behavior?

---

<div class="post-metadata">

**Author:** ![jjguillenes](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@jjguillenes](https://forum.inductiveautomation.com/u/jjguillenes)\
**Post date:** [May 13, 2022, 10:30am UTC](https://forum.inductiveautomation.com/t/vertical-text-truncated/7945/6 "2022-05-13T10:30:01Z")

</div>

> [@Carl.Gould](#):
>
> ]from java.lang import Math  
> from java.awt import RenderingHints
> 
> g = event.graphics  
> g.setRenderingHint(RenderingHints.KEY\_ANTIALIASING, RenderingHints.VALUE\_ANTIALIAS\_ON);  
> fm = g.getFontMetrics()
> 
> g.setColor(event.source.background)  
> g.fillRect(0,0,event.width,event.height)
> 
> stringWidth = fm.stringWidth(event.source.text)  
> g.setColor(event.source.foreground)  
> g.rotate(-Math.PI/2)  
> g.drawString(event.source.text,-stringWidth,fm.getHeight())

how can i rotate this to read it from top to bottom instead of from bottom to top?
