How to write a bold text in a textbox in guide, from the code? Is this possible?

 채택된 답변

per isakson
per isakson 2014년 6월 12일
편집: per isakson 2014년 6월 13일

1 개 추천

Correction:
FontWeight
light | {normal} | demi | bold
Weight of text characters. MATLAB uses this property to select a
font from those available on your particular system. Setting this
property to bold causes MATLAB to use a bold version of the font,
when it is available on your system.
Example
figure;
uicontrol( 'style', 'text', 'string', 'abcd1234', 'fontweight', 'bold' )
.
Original answer:
AFAIK: No, but see
and

댓글 수: 1

Valerio Biscione
Valerio Biscione 2014년 6월 12일
Thank you, that actually solves my problem completely.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Image Analyst
Image Analyst 2014년 6월 12일

2 개 추천

Try this (untested)
set(handles.text1, 'FontWeight', 'Bold');

댓글 수: 2

Valerio Biscione
Valerio Biscione 2014년 6월 12일
Thank you, I will try it.
Manuela
Manuela 2024년 8월 27일
it works fine for me!

댓글을 달려면 로그인하십시오.

Alan Meier
Alan Meier 2020년 7월 14일

0 개 추천

For me the easiest solution I found is also described in the TextBox Properties documentation page from Matlab. I just added
'FontWeight','bold'
to my annotation box. Although this is not specifically mentioned in the annotation documentation it works fine. So I ended up with the following line:
dim = [.825 .2 .8 .65];
annotation('textbox',dim,'String','boldString','FitBoxToText','on','FontSize',14,'FontWeight','bold','linestyle','none');

댓글 수: 1

Image Analyst
Image Analyst 2020년 7월 14일
There are a lot of things you can change. They're not all explicitly spelled out in the annotation documentation but it is mentioned like this:
Each type of annotation object supports a different set of properties. For a full list of properties and descriptions for each type, see the associated property page.
So it's not mentioned explicitly -- it's there, but there's an additional click you have to do.

댓글을 달려면 로그인하십시오.

질문:

2014년 6월 12일

댓글:

2024년 8월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by