From: Sergey V. U. <ser...@cl...> - 2001-02-27 21:23:49
|
Hi all jEdit is lovely. But today the main "buzzword" in X world is antialiazing. Several days ago J developers released the version which has this nice feature. Will jEdit have it? AFAIK it is very easy in Java 2D... Usual fonts under X look really ugly in jEdit... Regards, Sergey |
From: mike d. <md...@st...> - 2001-02-27 21:45:06
|
On Tue, 27 Feb 2001, Sergey V. Udaltsov wrote: > jEdit is lovely. But today the main "buzzword" in X world is antialiazing. > Several days ago J developers released the version which has this nice > feature. Will jEdit have it? AFAIK it is very easy in Java 2D... Usual fonts > under X look really ugly in jEdit... it does indeed look pretty easy, though since jEdit supports JDK 1.1, the implementation could be a bit tricky. here's a useful URL i found: http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html there is discussion of antialiasing in section 8. we could have a subclass of TextAreaPainter (e.g. TextAreaPainter2D) that made use of the Java2D that could be available to those running under JDK 1.2 or higher. it could be controlled by an option, e.g. "high quality text display" in the Editor option pane. -md |
From: Sergey V. U. <ser...@cl...> - 2001-02-27 23:17:54
Attachments:
jedit.aliased.jpg
jedit.orig.jpg
|
> we could have a subclass of TextAreaPainter (e.g. TextAreaPainter2D) that made > use of the Java2D that could be available to those running under JDK 1.2 or > higher. it could be controlled by an option, e.g. "high quality text display" > in the Editor option pane. Wow! I've just did small dirty hack - and I like it! I've just created in GUIUtilities: public static void improveImage( Graphics gfx ) { RenderingHints renderHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); renderHints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); renderHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); final Graphics2D g2 = (Graphics2D)gfx; g2.setRenderingHints(renderHints); } After that, I changed TextAreaPainter.java (modified paintComponent function) and BrowserView.java (added paintComponent). Definitely, all other components can be "improved" as well. No settings, no options. Not JDK 1.1 compartible. But looks really better than before! Sorry for the attachement - I think it is worth looking. Hope I will not be excommunicated:) Regards, Dr. Sergey V. Udaltsov |
From: Artur B. <ab...@pg...> - 2001-02-28 12:42:12
|
"Sergey V. Udaltsov" wrote: > > Sorry for the attachement - I think it is worth looking. Hope I will not > be excommunicated:) You know, showing antialiasing in jpeg is a bit pointless :) Png would be better here. Artur |
From: Slava P. <sp...@gj...> - 2001-02-28 08:31:56
|
"Sergey V. Udaltsov" wrote: > > Hi all > > jEdit is lovely. But today the main "buzzword" in X world is > antialiazing. Several days ago J developers released the version which > has this nice feature. Will jEdit have it? AFAIK it is very easy in Java > 2D... Usual fonts under X look really ugly in jEdit... > This can be done in a plugin. Just add a TextAreaHighlight that sets the appropraite graphics flags to enable anti-aliasing. Since highlights are painted before text, this will result in anti-aliased text. Slava |
From: Dirk M. <dmo...@gm...> - 2001-02-28 13:44:25
Attachments:
AntiAliasPlugin-1.0.zip
|
Slava wrote: > This can be done in a plugin. Just add a TextAreaHighlight that sets the > appropraite graphics flags to enable anti-aliasing. Since highlights are > painted before text, this will result in anti-aliased text. Well, here it is. Just put it in your jars/ directory, and all text area's are anti-aliased. To use normal fonts again, simply uninstall the plugin with PluginManager. Mike, if you like you can put this on PC and check it in CVS, please. PS: Alas, aliased fonts look ugly on Sun JDK 1.3.0/Windows NT 4.0, because they are aliased much to aggressively (lines are too thin etc.). Does anybody know how to configure that? PPS: jEdit has some cursor positioning problems on anti-aliased variable width fonts like Serif, which I use excessively. Probably has something to do with wrong FontMetrics handling. However, everything's fine if I don't use anti-aliased fonts. Dirk. -- Sent through GMX FreeMail - http://www.gmx.net |
From: Dirk M. <dmo...@gm...> - 2001-02-28 13:58:00
|
Oh, I forgot to add that it, of course, requires JDK >= 1.2 and jEdit >= 3.0final. Dirk. -- Sent through GMX FreeMail - http://www.gmx.net |
From: mike d. <md...@st...> - 2001-02-28 19:38:13
|
On Wed, 28 Feb 2001, Dirk Moebius wrote: > PPS: jEdit has some cursor positioning problems on anti-aliased variable > width fonts like Serif, which I use excessively. Probably has something to do > with wrong FontMetrics handling. However, everything's fine if I don't use > anti-aliased fonts. there is a KEY_FRACTIONALMETRICS in RenderingHints for fractional font metrics. i don't know what effect it has, but you might try playing around with that. try VALUE_FRACTIONALMETRICS_ON (or _OFF, perhaps). the original link to the J text editor mentioned font problems under Windows with antialiasing. they seem to provide a kludge where the font metric values are tweaked by constants in their props file. yuk. -md |
From: Dirk M. <dmo...@gm...> - 2001-02-28 21:19:12
|
> there is a KEY_FRACTIONALMETRICS in RenderingHints for fractional font > metrics. > i don't know what effect it has, but you might try playing around with > that. > try VALUE_FRACTIONALMETRICS_ON (or _OFF, perhaps). Tried both, without success. :-( If I set VALUE_FRATIONALMETRICS_OFF, the problem doesn't occur with _some_ font sizes, like 10, 12, but it occurs with 9, 11, etc. Strange. Probably a VM bug or a TrueType font problem. Dirk. -- Sent through GMX FreeMail - http://www.gmx.net |
From: Sergey V. U. <ser...@cl...> - 2001-02-28 20:06:51
|
> Just put it in your jars/ directory, and all text area's are anti-aliased. > To use normal fonts again, simply uninstall the plugin with PluginManager. Cool! > PS: Alas, aliased fonts look ugly on Sun JDK 1.3.0/Windows NT 4.0, because > they are aliased much to aggressively (lines are too thin etc.). Does anybody > know how to configure that? It seems that some things in Java2D are not configurable:( BTW, what about Xrender support in JVMs?:) But I still repeat - besides TextArea, people would be interested in aliased fonts in other areas (browsers, trees, console etc.) Is it possible to do this using generic Plugin API or should the jEdit sources be modified directly? Definitely, there should be an option to turn the AA off (preferable - in Text/Menu/Browser areas separately). Unfortunately I do not have write access to the jEdit CVS so I will not be able to do this. Sergey |
From: Dirk M. <dmo...@gm...> - 2001-02-28 21:23:51
|
> But I still repeat - besides TextArea, people would be interested in > aliased fonts in other areas (browsers, trees, console etc.) Console maybe, but I wouldn't want it on any GUI element like menu, buttons, trees etc. GUI elements are meant to be crisp and clear. AA only makes sense where you read huge amounts of text, like in the edit pane. Just my € 0.2. > Is it possible to do this using generic Plugin API or should the jEdit > sources be modified directly? The latter can't be, because it would break JDK 1.1 compatibility, unless invoked via reflection. I doubt it can be done with a plugin. > Definitely, there should be an option to turn the AA off (preferable - > in Text/Menu/Browser areas separately). > > Unfortunately I do not have write access to the jEdit CVS so I will not > be able to do this. Sire, give this man a CVS account! :-) Dirk. -- Sent through GMX FreeMail - http://www.gmx.net |
From: Sergey V. U. <ser...@cl...> - 2001-02-28 22:41:46
|
> Console maybe, but I wouldn't want it on any GUI element like menu, buttons, Absolutely agree. All this should be configurable and default for menus should be "off". But some strange people would like for some reason to have AA menu - why should we stop them if it just a line of code? I insist this is just matter of configuration - no more. I tried to use AA menu and buttons - they look really bad. But the file browser really rocks with AA (see my screenshots). > trees etc. GUI elements are meant to be crisp and clear. AA only makes sense > where you read huge amounts of text, like in the edit pane. Just my € > 0.2. Definitely. > The latter can't be, because it would break JDK 1.1 compatibility, unless > invoked via reflection. I doubt it can be done with a plugin. Well, reflection isn't so bad (especially with HotSpot) but it is not necessary here, I guess. There can be some class which is called for Java 2 only (checking system properties before the call). BTW, for discussion (just a question - not for flame, definitely) - how long will jEdit support JDK 1.1? Probably, Slava will comment this issue? It is not technical but rather organizational/political question. Any comments would be appreciated. > > Unfortunately I do not have write access to the jEdit CVS so I will not > > be able to do this. > Sire, give this man a CVS account! :-) :-E Regards, Sergey |
From: Slava P. <sp...@gj...> - 2001-03-01 03:46:56
|
"Sergey V. Udaltsov" wrote: > > The latter can't be, because it would break JDK 1.1 compatibility, unless > > invoked via reflection. I doubt it can be done with a plugin. > Well, reflection isn't so bad (especially with HotSpot) but it is not > necessary here, I guess. There can be some class which is called for > Java 2 only (checking system properties before the call). > BTW, for discussion (just a question - not for flame, definitely) - how > long will jEdit support JDK 1.1? Probably, Slava will comment this > issue? It is not technical but rather organizational/political question. > Any comments would be appreciated. I will switch to Java 2 when compelling features come along that must be done in the core and not as a plugin. Currently, Java 2 offers almost no advantages; drag and drop is one, I guess, but there isn't much else useful stuff in Java 2 (useful to jEdit, anyway). > > > Unfortunately I do not have write access to the jEdit CVS so I will not > > > be able to do this. > > Sire, give this man a CVS account! :-) > :-E What is your SourceForge username? If you don't have one, you must get one before having write access to the CVS. Slava |
From: Slava P. <sp...@gj...> - 2001-03-01 03:34:14
|
Dirk Moebius wrote: > Just put it in your jars/ directory, and all text area's are anti-aliased. > To use normal fonts again, simply uninstall the plugin with PluginManager. > > Mike, if you like you can put this on PC and check it in CVS, please. Could you make it configurable first, before posting it on PC? Slava |
From: Sergey V. U. <ser...@cl...> - 2001-02-28 20:06:54
|
> This can be done in a plugin. Just add a TextAreaHighlight that sets the > appropraite graphics flags to enable anti-aliasing. Since highlights are > painted before text, this will result in anti-aliased text. I cannot agree. Except TextArea we have a lot of browsers, trees etc. These controls also look much better with anti-aliasing. BTW, I found the menus look worse with AA. Regards, Sergey |
From: Slava P. <sp...@gj...> - 2001-03-01 03:40:35
|
"Sergey V. Udaltsov" wrote: > > > This can be done in a plugin. Just add a TextAreaHighlight that sets the > > appropraite graphics flags to enable anti-aliasing. Since highlights are > > painted before text, this will result in anti-aliased text. > I cannot agree. Except TextArea we have a lot of browsers, trees etc. > These controls also look much better with anti-aliasing. BTW, I found > the menus look worse with AA. The 'Java look and feel version 2' that will ship with Java 1.4 will include AA by default for all Swing controls. So we only have to worry about custom controls (ie, the text area) and wait for Sun to do the rest. Slava |