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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...