A text editor supporting DIFFERENT fonts according to syntax highlighting rules
GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't understand. A text file has no concept of fonts. If you select a paragraph and change the font, how is it supposed to store that in the text file?
KWrite supports syntax highlighting but I can't change the font of a particular paragraph. There is one font for the whole file.
Plain text doesn't support "font for paragraph" - this is an office suite(open office)/html/rtf editor feature.
The best you might be able to get is text editor that uses different fonts according to syntax highlighting rules.
Plain text doesn't support "font for paragraph" - this is an office suite(open office)/html/rtf editor feature.
The best you might be able to get is text editor that uses different fonts according to syntax highlighting rules.
Thanks for clarifying my misconception about text editors.
Actually I want a text editor which supports different fonts for different types of syntaxes. Like a different font for comments and data types. I have started writing the notes on laptop instead of paper, so it contains code too and documentation too. I'll change the title.
Quote:
Originally Posted by Guttorm
I don't understand. A text file has no concept of fonts. If you select a paragraph and change the font, how is it supposed to store that in the text file?
Thanks to you too, I couldn't understand what you were saying, but SigTerm explained it better.
Last edited by Aquarius_Girl; 04-04-2011 at 09:26 AM.
I don't understand, did you think text editors allow you to edit fonts like a work processor or did SigTerm misunderstand you?
Quote:
Originally Posted by Anisha Kaul
Thanks for clarifying my misconception about text editors.
Actually I want a text editor which supports different fonts for different types of syntaxes. Like a different font for comments and data types. I have started writing the notes on laptop instead of paper, so it contains code too and documentation too. I'll change the title.
Isn't bold and italic enough? Most editors support that.
I guess that the reason many editors might not have that feature is that if it were implemented, you cannot easily just change your font. You would have to change all the syntax rules in all the languages.
Actually I want a text editor which supports different fonts for different types of syntaxes. Like a different font for comments and data types.
Umm... it is possible to make this if syntaxes you need can be explained as regexps(i.e. if it can be explained as a set of syntax highlighting rules).
I do not remember any text editor that can do something like that - normally they're all limited to single font.
You can write one, of course (Qt 4 has QPlainTextEditor class that allows setting text attributes (color/font) for individual characters, and there's syntax highlighter example), but (although it isn't that difficult) that'll take at least few days.
IMO, you have following options:
Switch to office suite, html editor or rtf editor.
Keep searching. Project like that might exist, although I've never heard about it.
Grab existing (opensource) editor that can display bold/non-bold font within same file and fork it to support multiple fonts (bold and non-bold font are two different fonts, so if same editor can display both bold and non-bold fonts at once, it can be probably tweaked to support several different fonts).
Write editor from scratch using a gui toolkit (Qt 4).
It would be easy to do when writing an editor from scratch, just add a font option (apart from the usual color, bold, and italic options) for every syntax rule.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.