LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-15-2007, 05:18 PM   #1
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Programming Fonts


Hello,

Do you have any recommendations on fonts to use while programming. I use the vim editor and it defaults to sans. What about courier? What about a proportional width font like times or arial?

Note: I know how to change the fonts, I want to know what some experienced programmers think is the better fonts - at least as far as such a subjective opinion can be recommended.
 
Old 09-15-2007, 09:30 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
Stick with a monospace font. Things tend to line up better that way.

Beyond that, it's a matter of taste. I'm not even aware of which font I'm using, as long as it's monospace.
 
Old 09-16-2007, 11:34 AM   #3
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Original Poster
Rep: Reputation: 30
Hello,

Quote:
Originally Posted by wjevans_7d1@yahoo.co View Post
Stick with a monospace font. Things tend to line up better that way.

Beyond that, it's a matter of taste. I'm not even aware of which font I'm using, as long as it's monospace.
I did an experiment with fonts used for source code in OpenOffice. I opted to use OpenOffice because it is much easier to switch fonts much more rapidly in OpenOffice - and since this was an experiment with the displays of fonts this seemed the best environment. I found that proportional width serif fonts, while perhaps slightly easier to read don't line up the text at all so any benefits gained by the serifs are lost by the inconsistency of placement and alignment. Fancy fonts (i.e., Old English, Monotype Corsiva, etc.) are extremely hard to read with source code, to the point of being absolutely illegible. The best were the monospaced fonts.

The winners are (note: these are only fonts on my system - and only those that are read by OpenOffice - and not every font in the world):

Courier
Courier 10 Pitch
Courier New
DejaVu Sans Mono
Bitstream Vera Sans Mono
 
Old 11-13-2007, 01:21 AM   #4
noble_curious
LQ Newbie
 
Registered: Nov 2007
Location: MARS
Distribution: Fedora 6
Posts: 14

Rep: Reputation: 0
hi
I want to know that In windows MFC provides methods/classes to manage font in GUI forms like getting complete information about text size,font,colour etc., while we can use win32 API for same purpose in windows console(DOS). But what is the story of fonts in linux. can i write a program which can read a file and tells its font information. say I want read a document file which has text in different size,font and color. how shall I read this file using C/C++ and get all the information about the text properties in this file. will i have to use any 3rd party library for this purpose or linux provides library for this. Also I am talking about simple C/C++ program that may run from the terminal.
One another question can I print text on terminal(bash) such that the text has different size, font and color. if yes then how. I need answers and hints from the linux geeks and programming gurus.
Regards
 
Old 11-13-2007, 01:30 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Your document wouldn't be a text file then because it would have embedded font information, unless you are creating a document with markup information. Maybe you should start with what kind of document you want. rtf, xml, html???
 
Old 11-13-2007, 01:53 AM   #6
noble_curious
LQ Newbie
 
Registered: Nov 2007
Location: MARS
Distribution: Fedora 6
Posts: 14

Rep: Reputation: 0
Ok so this means that I cannot write text with different fonts to the terminal. But if I want to change size of the text in output to terminal can I do that or that is not possible either.
For reading text file you can help me to read rtf files. If I need to read rtf file in linux and get text font properties from that rtf document then how shall I write a c/c++ program for that
Regards
 
Old 11-13-2007, 02:52 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You might want to find a program in linux that already can do that and study it's source code.

The libraries that it uses may be of particular interest for study. Most likely such an app would be written for either gnome or kde in c++.

You might be interested in the "QSimpleRichText class" in QT.
 
Old 11-15-2007, 11:56 PM   #8
noble_curious
LQ Newbie
 
Registered: Nov 2007
Location: MARS
Distribution: Fedora 6
Posts: 14

Rep: Reputation: 0
Unhappy

Ok I understand now about the rich text stuff.
Now one more thing that I am feeling I need to know is about the Font Metrics. In windows we can get Font Metrics information through the device context object and other Win API functions.
But In Linux how can I get Font Metrics. Also the Font Metrics Attributes will be same or different on windows and Linux. I mean character size, spacing, height, width etc of the given font (say any ttf) will be same on both OS or there can be difference.
During searching I have found QFontMetrics class of QT library. I am reading it now but want to know if any body has used it before or may be familiar with this class may tell me if I am reading right class. Also there is a Free Type library .. any one know about this library. I havnt explored it yet but if someone know this library then I ask him to le me know if this is more suitable library to use for Font Metrics on Linux.

Also I need to know that does Linux have its own native API's for this purpose or it depends on these libraries.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Console] an xterm type with ttf fonts as fonts ? frenchn00b Linux - Desktop 1 08-04-2007 04:32 PM
what's diference betwen core fonts and xft fonts? xcore_on Linux - Newbie 2 04-29-2006 08:11 PM
fonts. Doom, Quake, Half-Life. programming tip for Debian 3.1 t3gah Programming 0 06-01-2005 06:34 PM
Fonts question: how to get a full list of fonts in Abiword vharishankar Linux - Software 1 03-17-2005 11:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration