"L. Gilardoni" wrote:
> 
> Hussein - seen the message on the mailing list:
> 
> >By the way, tell me if in your environment, you can put the caret on the
> >middle of the letter in a styled document view.
> >
> I've not yet tried 2.3, but older version of XXE had exactly this
> problem (the only one I must say but I've not
> done much testing)
> 
> >And if the answer is yes, in which circumstances.
> >
> >And if the answer is yes, have you found any workaround for this (e.g.
> >changing fonts using Options|Options, Style tab, special Java properties
> >-Dxxx=yyy, etc).
> >
> No ... but:
> - the problem manifests within a styled view if part of the text on the
> line has been made bold (css: font-weight: bold).
> - in this case IF there are some chars (typically 'l') then string
> dimensions goes away ... the more 'l' you add in the bold part the more
> the caret
> move to the right
> - this does not happen with normal (not weighted) text
> - this happens with default font (looks like times) and with some others
> too (not made exhaustive tests). I should check with fixed width (courier).
> 
> There are obviously problems with font metrics, I could not understand
> if due to bad font (possible) or event to Quartz antialiasing (I tried to
> switch but with no success)
> Let me know if there is some test you may want I do.

XXE uses a method to compute the width of a string
(FontMetrics.stringWidth, FontMetrics.charsWidth) which is not
compatible with antialiased text in MacOSX 10.2/Java 1.4.1 (but which
was compatible with antialiased text on MacOSX 10.1/Java 1.3.1!).

The problem is glaring with some proportional fonts at certain sizes,
with certain letters and really not obvious with some fonts such as
Monaco (Use Options|Options, Style Tab, change SansSerif to Monaco).

Note that I can also reproduce this problem with Swing JTextField (with
certain fonts, for example, new demo bugreport.xml).

The solution to solve this should have been very simple and efficient:
add -Dapple.awt.textantialiasing=false (or off? or VALUE_ANTIALIAS_OFF?)
to the java command line. Unfortunately, this system property is ignored
(at least for Swing components such as XXE's DocumentView).

Switching to the Metal look and feel also solves the problem but the
Metal look and feel is terribly ugly (on all platforms but especially on
Mac). (Aqua LAF uses antialiased text, not Metal LAF.)

Therefore I'm going to programmatically  disable text antialiasing in
XXE's DocumentView (but not in ``Aqua'' controls). The drawback is that
the DocumentView will not be as nice as it could be. But on the positive
side, antialiased text is tiring for the eyes when you spend long hours
authoring documents.

Reply via email to