Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
FontSize

Subject: FontSize

From: Rajeev Narayanan

Date: 3 Mar, 2010 19:22:04

Message: 1 of 4

Hi,

I am using cprintf statement and need to use different font size for the text. how can i do it? Can somebody let me know. I appreciate it.

Thanks,
Rajeev

Subject: FontSize

From: Walter Roberson

Date: 3 Mar, 2010 19:37:25

Message: 2 of 4

Rajeev Narayanan wrote:

> I am using cprintf statement and need to use different font size for the
> text. how can i do it?

There is no cprintf function. Do you mean fprintf() or sprintf() ?

If you are writing data (text) into a file, then font size used will depend
upon the tool you use to examine the file. You may wish to use Rich Text
Format (RTF) and examine the file with a word or document processor, or you
may wish to use HTML and examine the file with a browser.

If you are creating text to be used by the text() or legend() functions, you
can possibly use tex or latex formatting codes to change the text size. The
default 'Interpreter' property for text() objects is LaTex. Note: Matlab uses
a fairly restricted version of tex and latex.

If you are creating text to be used as entries in a uicontrol() object, then
you can use HTML on a per-line basis. However, if you use HTML in uicontrols,
then Matlab does not take the meaning of the HTML into account in determining
the Extent property of the control, and it assumes that all the lines of a
list-box or pop-up will be the same height, so you will likely run into
problems rendering such controls properly; oh yes, and uicontrol of style edit
are likely to wrap the HTML completely wrongly, breaking the HTML...

Subject: FontSize

From: Jan Simon

Date: 3 Mar, 2010 20:10:19

Message: 3 of 4

Dear Rajeev!

> I am using cprintf statement and need to use different font size for the text. how can i do it? Can somebody let me know. I appreciate it.

If you use Yair's CPRINTF from the FEX to print colored text in the command window: As far as I know, you cannot change the font size.

Kind regards, Jan

Subject: FontSize

From: Yair Altman

Date: 3 Mar, 2010 21:00:23

Message: 4 of 4

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hmmfnb$p8n$1@fred.mathworks.com>...
> Dear Rajeev!
>
> > I am using cprintf statement and need to use different font size for the text. how can i do it? Can somebody let me know. I appreciate it.
>
> If you use Yair's CPRINTF from the FEX to print colored text in the command window: As far as I know, you cannot change the font size.
>
> Kind regards, Jan


This is correct. I haven't figured out a way to modify the font of a specific text segment (as opposed to the entire Command Window, which is easy) - only the color and underline properties. I haven't given up hope (yet?), but I have nothing to show for my efforts so far...

More information about CPRINTF: http://undocumentedmatlab.com/blog/cprintf-display-formatted-color-text-in-command-window/

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us