From: Philip W. <ph...@ph...> - 2006-06-06 19:34:35
|
I went ahead and tried that via System.setProperty() but no change. The main problem is that the caret and selections do not understand that the view is now painting aliased, and the character widths are off by one pixel - so the caret and selections are always off by (numchars * -1). The JTextpane does *render* the text aliased fine. It's just the caret and selections which are off. The jEdit text area is capable of rendering find with aliased text because I use it all the time with Monaco PLAIN 9 and aliased. But I just can't get a JTextPane to work right. Weave On Jun 6, 2006, at 1:58 PM, Alan Ezust wrote: > try adding some jvm args to the script that starts jedit: > > "-Dawt.useSystemAAFontSettings=on" "-Dswing.aatext=true" > > > On 6/6/06, Philip Weaver <ph...@ph...> wrote: >> >> I'm having some trouble with font metric, aliased text, and a >> JTextPane. I am able to get a JTextPane in my plugin to paint using >> aliased text - however, the caret position painting is always skewed. >> I >> did have a solution at one point but it causes an exception >> (untraceable at this time) but only when running inside jEdit as a >> plugin. In that solution I was basically hijacking FontMetrics and >> tweaking it. This is on Mac OS X and this entire issue may be a bug on >> Mac OS X - but the jEdit text area is successful at working with >> aliased text. >> >> Here's what I'm doing: In my subclass of JTextPane (or in a separate >> TextUI class), in paintComponent(Graphics), I am setting rendering >> hints: >> RenderingHints.KEY_FRACTIONALMETRICS = >> RenderingHints.VALUE_FRACTIONALMETRICS_OFF >> RenderingHints.KEY_TEXT_ANTIALIASING = >> RenderingHints.VALUE_TEXT_ANTIALIAS_OFF >> The text paints correctly - but the model of the text pane doesn't >> seem >> understand that the font metrics are one pixel too narrow per >> character. Can you provide some direction? FontRenderContext? >> LineMetrics? FontMetrics? GlyphMetrics? >> >> I'm posting this question to the jEdit development list because :-) 1. >> jEdit is a text editor, 2. the jEdit text area already does correctly >> render aliased text on my platform: MacOS, 3. I'm writing several >> plugins at the moment. I have the jEdit source but I'm still looking >> for some direction. >> >> Weave >> >> >> >> -- >> ----------------------------------------------- >> jEdit Developers' List >> jEd...@li... >> https://lists.sourceforge.net/lists/listinfo/jedit-devel >> > |