1
$\begingroup$

This command seems to work for changing the font used in output

$PrePrint = Style[#, FontFamily -> "Arial"] &;

Is there a way to make a button which can in a way or an other list all available fonts, size, color when using such a command.

$\endgroup$
2
$\begingroup$

I'm uncertain if you want to know what options you can use or if you want to know how to build a button to apply the styling.

If you want to list all of your system fonts, you can get them via $FontFamilies.

FontColor can be any color you like, so just choose some Hue[h,s,b] value (I find this somewhat easier to use that RGBColor[r,g,b]).

FontSize is any positive integer

FontWeight can be Bold, Plain, or DemiBold (for some fonts).

If you want flexible auto-styling just create a $styleSpec variable you can change at whim.

$styleSpec={
 FontFamily->"Arial",
 FontColor->Hue[.6,.5,.5],
 FontWeight->"DemiBold"
 };
$PrePrint = Style[#, Sequence@@$styleSpec] &;

That ought to do it.

If you want to do it in a button you can do so via either a SelectedCells mechanism or via FrontEndTokenExecute, the first of which is seen here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.