Vertical text truncated

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]

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]

2 Likes

Thanks for the tips.
A bit cumbersome but it works !
:thumb_left:

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

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