For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > April 2004 > How do I change the font in VisualWorks?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How do I change the font in VisualWorks?
Loryn Jenkins

2004-04-12, 10:42 am

I want to be able to read and edit Smalltalk code in a font easier on
the eyes than that selected as the default in VisualWorks. How do I
change the font for all code (Browsers, Workspace, Transcript,
Debugger, etc.)?
Martin Kobetic

2004-04-12, 11:42 am

Loryn Jenkins wrote:

> I want to be able to read and edit Smalltalk code in a font easier on
> the eyes than that selected as the default in VisualWorks. How do I
> change the font for all code (Browsers, Workspace, Transcript,
> Debugger, etc.)?


You'll want to adjust the parameters in FontDescription below to your
liking.

| style cStyle |
cStyle := CharacterAttributes newWithDefaultAttributes.
cStyle setDefaultQuery: (
FontDescription new
family: #('helv' 'helvetica' 'arial' '*');
pixelSize: 20;
yourself).
style := TextAttributes new.
style setCharacterAttributes: cStyle.
TextAttributes
styleNamed: #betterDefault put: style;
setDefaultTo: #betterDefault;
resetViews.

If you need to change back to default, evaluate:

TextAttributes
setDefaultTo: #default;
resetViews.

HTH,

Martin

--
Martin Kobetic, Cincom Smalltalk Development,
http://www.cincom.com/smalltalk
Loryn Jenkins

2004-04-17, 10:32 pm

Thank you. That works wonderfully!

I have a 1600x1200 screen res. Running with the following font
descriptor is so, so much better than the default VisualWorks NC font.

setFont
"Set the fonts to using ProFont"

| style cStyle |
cStyle := CharacterAttributes newWithDefaultAttributes.
cStyle setDefaultQuery: ((FontDescription new)
family: #('ProFontWindows');
pixelSize: 11;
fixedWidth: true;
yourself).
style := TextAttributes new.
style setCharacterAttributes: cStyle.
TextAttributes
styleNamed: #lorynsDefault put: style;
setDefaultTo: #lorynsDefault;
resetViews


I'm left with a question then: I can see this is an incredibly
powerful, and exciting paradigm for configuring my working
environment, but, other than asking questions here, how do I discover
how to customize the environment myself?
Martin Kobetic

2004-04-19, 1:49 pm

You're mostly stuck with the traditional ways of discovery - exploration
:-). The IDE itself is just a smalltalk application that happens to be
preloaded in your smalltalk image.
It's a both a curse and a blessing, depending on your point of view :-).
Since it's all at your finger tips, available for inspection and
modification, it opens up endless possibilities for customization.
However it also reduces the chances that it will ever be comprehensively
documented to zero.
I'd say that the fastest way to learn about particular aspect of the
environment is to:

1) see if somebody else wrote about it in the past (search c.l.s, vwnc
vw wiki). Many people modify the environment. It's quite likely that
somebody has done what you want before, unfortunately the results are
rarely published. I know I've got quite a few tweaks that I never wrote
about for various reasons.

2) take a quick look around in the image on your own, to see if you can
find and understand the relevant code (you'll see that you'll get better
at this as time goes). Even if you don't know where to look, just trying
couple of wildcard searches for class names or selectors that might be
related to the issue can yield useful results.

3) ask a question (c.l.s, vwnc). Even if you don't get a solution in a
response, you may get some useful initial pointers to focus on in your
exploration. It is also better to ask more focused questions. Long
answers take time to write and may discourage potential responders if
they are busy.

4) roll up your sleeves and browse, inspect, probe, debug, modify,
extend until you get what you want. Don't be afraid. You will quite
likely destroy couple of images, before you get there, but saving the
image before doing anything dangerous allows you to revert to previous
stable state very easily. If you manage to save your image in a broken
state, you may need to rebuild it from scratch, so I'd also recommend
keeping your modifications in a package of your own, and publishing it
frequently (or save it as a parcel if you don't use Store).
If you get stuck ask more questions. It seems that more specific
questions have better chance to get a response than general ones.

I find it that the effort is usually worth it. You'll like your
environment more, you'll learn a lot in the process, and it's often fun.

Good luck !

> I'm left with a question then: I can see this is an incredibly
> powerful, and exciting paradigm for configuring my working
> environment, but, other than asking questions here, how do I discover
> how to customize the environment myself?



--
Martin Kobetic, Cincom Smalltalk Development,
http://www.cincom.com/smalltalk
Loryn Jenkins

2004-04-20, 4:45 am

Thanks for your advice, Martin.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com