Jump to content
Sign in to follow this  
Czar

Labels truncate to ... when bold

Recommended Posts

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';

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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';

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×