Jump to content


Photo

Labels truncate to ... when bold


  • Please log in to reply
4 replies to this topic

#1 Czar

Czar
  • Members
  • 153 posts

Posted 23 August 2017 - 02:58 AM

ON some computers I have found that my labels, generated in code, are truncated.

e.g., TABLES becomes TABL...

Changing the width and or height of the label does not make a difference.

I have found that taking BOLD off fixes the problem. At a guess I would say the bold is pushing the label beyond some barrier resulting in it being truncated.

Has someone got a solution for me?

I have attached both CSS and the code

.hit-the-floor {
color: #eee;
font-weight: bold;
font-family: Helvetica;
font-size: 48px;
text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa,
0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3),
0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 10px 10px rgba(0,0,0,.15);

}

TablesLabel := tw3label.Create(ButtonPanel);
TablesLabel.caption := 'TABLES';
TablesLabel.left := 0; TablesLabel.top := 00;
TablesLabel.width := 560; TablesLabel.height := 100; //<= changing these makes no difference
TablesLabel.aligntext :=taCenter;
TablesLabel.styleclass := 'hit-the-floor';

#2 Igor Savkic

Igor Savkic
  • Members
  • 185 posts

Posted 23 August 2017 - 03:14 AM

I've got similar issues but I don't quite remember the right cause (if it was something like autosize or css). Try to specify text-overflow or try using TW3SimpleLabel.
  • Czar likes this

#3 Czar

Czar
  • Members
  • 153 posts

Posted 23 August 2017 - 07:21 AM

I ended up using the simplelabel

#4 jarto

jarto
  • Administrators
  • 40 posts
  • LocationVaasa, Finland
  • Enterprise Edition

Posted 23 August 2017 - 11:45 AM

I'll test this to make sure that the bug won't be in the new RTL. One possibility is to also use a simple TW3CustomControl and set the InnerText.
  • Czar likes this

#5 jarto

jarto
  • Administrators
  • 40 posts
  • LocationVaasa, Finland
  • Enterprise Edition

Posted 23 August 2017 - 12:41 PM

Yep, can't reproduce this in the new TW3Label. It actually is completely rewritten, so I unfortunately can't give you a quick fix. But if you want to do this with a simple TW3CustomControl, here's how to do it:

TablesLabel := TW3CustomControl.Create(Self);
TablesLabel.InnerText := 'TABLES';
TablesLabel.left := 0; TablesLabel.top := 00;
TablesLabel.width := 560; TablesLabel.height := 100;
w3_setStyle(TablesLabel.Handle, 'text-align', 'center');
TablesLabel.styleclass := 'hit-the-floor';
  • Czar, ielite and BobLawrence like this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users