How to set the default font of a Text View?

The default font of every Text View seems to be “Helvetica” 12pt and I would like to change that to “Menlo” 14pt. How could I do that?

I tried it with tell noteField to fontWithName_size_(“Menlo”, 14) but it doesn’t work. I’m I far away to get it to work?

Try something like:

tell notFiled to setFont_(current application's NSFont's fontWithName_size_("Menlo", 14))

Just remember if you plan on handing this app out, you will need to make sure that they new host computer has that font installed. You can carry the font in the app and load it before opening main window.

@Shane Thank you, you’re my hero! I I bought your book AppleScriptObjC Explored (which I love) but the chapter “Doing Text in Style” was a bit too abstract for me as a newbee. With your little snipped it finally works fine.

@petekin74 My Application only has to run on Mac OS X 10.6 and Menlo is one of the preinstalled fonts there. But thank you for your tip. Didn’t know I could do that.

Are you sure Menlo is pre-installed? I thought I saw a suggestion that it’s installed with Xcode, but maybe it just uses it.

I’m absolutely sure about this. Menlo is part of Mac OS X 10.6 Snow Leopard. I just double checked it on a machine on which the Developer Tools where never installed.

There is also a nice article about some details over at ars technica.
http://arstechnica.com/apple/news/2009/06/font-changes-coming-to-mac-os-x-snow-leopard.ars

Interesting, thanks. I wonder why it’s not in the fixed-width group.

On my iMac and on my MacBook Menlo is in the fixed-width group and I think I’ve never added it there manually.

My system language is set to german and the groups name here is “Feste Laufweite”, maybe it is a little localization bug? But usually, localization bugs are not in the original English :slight_smile: