Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:10:58+00:00 2026-05-28T08:10:58+00:00

If I evaluate e.g. SystemDialogInput[Color] and choose a colour, lets say red, the output

  • 0

If I evaluate e.g. SystemDialogInput["Color"] and choose a colour, lets say red, the output cell shows RGBColor[1,0,0].

To view the font panel I can evaluate FrontEndTokenExecute["FontPanel"]. If I have some text highlighted somewhere I can change the font styling of the highlighted text (or cell) from the system panel that appears from the FrontEndTokenExecute. What I am wondering is if there is a way to programmatically return the chosen font settings analogous to how SystemDialogInput["Color"] returns the chosen color. For example, evaluate some code that includes choosing font settings within the system font panel, lets say manually choose Arial 12pt bold in the font panel,

enter image description here

and return e.g.

{FontFamily->"Arial",FontSize->12,FontWeight->Bold}

Just so we’re clear I’m talking about doing this without any highlighted text or cell in the notebook. One of the problems seems to be — on a Mac at least — that the font is only selected if you have highlighted something in the notebook. There are some examples like this in the documentation (ref/CurrentValue):

Style["xxxx", FontFamily :> CurrentValue["ControlsFontFamily"], 
 FontSize :> CurrentValue["ControlsFontSize"]]

This suggest that an answer is possible if the appropriate argument to CurrentValue exists but “ControlsFontFamily” and “PanelFontFamily” are not the right arguments in this case.

Also is it possible to programmatically list all fonts available on a particular computer?

Edit

@kguler has provided an answer to the final sentence and second part of my question — this could be used to build my own font panel. I have run @Heike’s code and got this (screen grab) on Mac OS X 10.6.8 with Mma 8.0.4. Note the shadowing of PropertyValue with ref/PropertyValue.

enter image description here
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:10:59+00:00Added an answer on May 28, 2026 at 8:10 am

    I think the example under Generalizations & Extentions on the help page for "FontChooser" in the documentation center does what you want. The code for that example is

    Needs["GUIKit`"]
    
    GUIRunModal[
     Widget["Panel", {
       Widget["FontChooser", {
         "showLogicalFonts" -> False,
         PropertyValue[{"chooser", "selectionModel"}, 
          Name -> "fontSelectionModel"], 
         BindEvent[{"fontSelectionModel", "change"},
          Script[updateFont[]]]
         }, Name -> "chooser"],
       Widget["TextField", {"text" -> ""}, Name -> "myTextField"],
       Script[
        fontExpr = {};
        updateFont[] := Module[{newFont},
          newFont = 
           PropertyValue[{"fontSelectionModel", "selectedFont"}];
          fontExpr = {
            FontFamily -> PropertyValue[{newFont, "family"}],
             FontSize -> PropertyValue[{newFont, "size"}], 
            FontWeight -> 
             If[PropertyValue[{newFont, "bold"}], "Bold", "Plain"], 
            FontSlant -> 
             If[PropertyValue[{newFont, "italic"}], "Italic", "Plain"]
            };
          SetPropertyValue[{"myTextField", "text"}, ToString[fontExpr]];
            ];
          ],
       BindEvent["endModal", Script[ fontExpr]]
       }]
     ] 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to evaluate a list of statements for a Cell (e.g. has top
Say I need to evaluate a expression as true or false starting from a
I'm trying to evaluate the use of Windows Azure storage/media/cdn services to host the
Does this code always evaluate to false? Both variables are two's complement signed ints.
My application tries to evaluate a server trust certificate for a self signed certificate.
we need to evaluate a value in an object in run time while we
Will the following query evaluate to true (1), false (0), or NULL? SELECT '%'
I need to evaluate and dig more into the use of Remote Procedure Call
I'm trying to evaluate an xml node using xpath and i'm not sure why
I'm trying to evaluate an XPath varable I'm building dynamically based on the position

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.