Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: CBXE8 - How to set font to Bold programmatically in Android ?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Oct 28, 2015 10:10 AM Last Post By: Remy Lebeau (Te...
GAI CHEW KAI

Posts: 117
Registered: 7/25/14
CBXE8 - How to set font to Bold programmatically in Android ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 11:11 PM
Embarcadero® C++Builder XE8 Version 22.0.19027.8951 and Indy 10.
Window 10 Pro x64, Version 10.0.10240
Android 4.1.2

QUESTIONS

1. How to set font to Bold programmatically ? I have tried the following methods but won't work in Android.

METHOD 1:
Label1->Font->Style << TFontStyle::fsBold;

METHOD 2:
Label1->Font->Style <<= TFontStyle::fsBold;

METHOD 3:
http://edn.embarcadero.com/article/42398

TFontStyles AStyle(1);
if (Label1->Font->Style.Contains(TFontStyle::fsBold))
Label1->Font->Style = Label1->Font->Style - AStyle;
else
Label1->Font->Style = Label1->Font->Style + AStyle;

Please advise.

Mike Collins

Posts: 46
Registered: 9/23/05
Re: CBXE8 - How to set font to Bold programmatically in Android ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2015 5:56 AM   in response to: GAI CHEW KAI in response to: GAI CHEW KAI
Help file shows:

Label1->Font->Style = TFontStyles() << fsBold << fsUnderline;

- to bold and underline.

Label1->Font->Style = TFontStyles();

- to reset.

You might have to adjust on Fmx:

Label1->Font->Style = TFontStyles() << TFontStyle::fsBold;

HTH

Mike

GAI CHEW KAI

Posts: 117
Registered: 7/25/14
Re: CBXE8 - How to set font to Bold programmatically in Android ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 8:01 AM   in response to: Mike Collins in response to: Mike Collins
> You might have to adjust on Fmx:
>
> Label1->Font->Style = TFontStyles() << TFontStyle::fsBold;

- Already tested, still unable to bold the label text programmatically.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: CBXE8 - How to set font to Bold programmatically in Android ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 10:10 AM   in response to: GAI CHEW KAI in response to: GAI CHEW KAI
GAI wrote:

How to set font to Bold programmatically ?

You have to remove the TStyledSetting::Style flag from the Label1->StyledSettings
property, then you can assign the Label1->TextSettings->Font->Style property
as desired. If the Style flag is enabled, the control gets its font style
from the current theme and it cannot be changed manually.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02