Meaningless Drivel is fun!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes which font to use inside Eclipse IDE... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "which font to use inside Eclipse IDE..." Watch "which font to use inside Eclipse IDE..." New topic

which font to use inside Eclipse IDE...

Rick Stewart

Joined: Mar 02, 2006
Posts: 16
Hi all,

The Developers assignment seems to be touchy about spacing and having your comments all line up, etc.. I have noticed that when I develop an application on my Eclipse IDE everything looks good and properly formatted on my screen, but sometimes on another IDE or simple editor the formatting looks messed up, for example the comments no longer appear in a straight line, or a line runs past the 80 column mark. I have Eclipse set up so that tab inserts real spaces, 4 of them.

My concern is that when I submit the assignment to be marked, the formatting that looks good on my PC will look bad on the marker's PC.

Is there a particular font type and size that I need to be using to generate my codes?

Honesty IS the best policy, but occasionally reality throws an exception...
Harry Pearson

Joined: Nov 14, 2006
Posts: 3
Hi Rick

One reason things could be getting out of line is if you aren't using a fixed-width font (Courier, Monospace, etc.)

Different fonts won't affect the actual characters in the source code file. Just make sure you are using a fixed-width font and it will all fall back into line
[ November 23, 2006: Message edited by: Harry Pearson ]
Rick Stewart

Joined: Mar 02, 2006
Posts: 16
Hi Harry,

I checked the various editors at home and at work and you were correct, a few of them were using variable width fonts. I've now set everything up with the new courier font, 10 pitch, and I can now move source code between any two editors and everything keeps its place as it should.

Thanks for the tip.

Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 918


I have some tips
1.tabulate with space not with tab.
2.Use a mono font - in this case each character (the space also) will have the same size.
3.Test you format with more than one editor - the best one is vi (for linux)
or the old ms-dos edit.exe. If here is looking ok than is ok.
4.Use the 80 character line limit - take care this is now working with all the fonts, you can test it by typing 80 characters and changing the font.

Regards M
[ November 25, 2006: Message edited by: Mihai Radulescu ]

Rick Stewart

Joined: Mar 02, 2006
Posts: 16
Some good tips Mihai, thank you!

I agree. Here's the link:
subject: which font to use inside Eclipse IDE...
It's not a secret anymore!