This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 234405 - [Mac OSX w/ retina display] many fonts show a gap after italics
Summary: [Mac OSX w/ retina display] many fonts show a gap after italics
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P2 normal with 5 votes (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 20:26 UTC by athompson
Modified: 2013-12-05 13:14 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
there is no space between "IDENTITY" and ")" (18.99 KB, image/png)
2013-08-14 20:26 UTC, athompson
Details
there is no space between "IDENTITY" and ")" (17.99 KB, image/png)
2013-08-14 20:27 UTC, athompson
Details
settings dir (6.33 MB, application/zip)
2013-08-20 19:00 UTC, athompson
Details
same problem on my retina (22.85 KB, image/png)
2013-09-27 00:02 UTC, maxnitribitt
Details
Rendering issues (35.54 KB, image/png)
2013-10-14 10:48 UTC, Stanislav Aubrecht
Details
space after italics text in code editor (77.56 KB, image/jpeg)
2013-11-04 17:43 UTC, MrJxN
Details

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2013-08-14 20:26:15 UTC
Created attachment 138704 [details]
there is no space between "IDENTITY" and ")"

This is a regression from a very long time ago. Many fonts (especially variable width fonts) show a gap after italic identifiers. This can easily be mistaken for a space and depending on the context/syntax can be extremely confusing.
Comment 1 athompson 2013-08-14 20:27:53 UTC
Created attachment 138705 [details]
there is no space between "IDENTITY" and ")"
Comment 2 Vladimir Riha 2013-08-15 06:04:06 UTC
Could you please specify which version of NetBeans are you using and which JDK? Simply copy & paste information from NetBeans->About dialog. And perhaps name of one font that causes this issue. I've tried it on Linux and it looks OK there. Thank you in advance


Product Version: NetBeans IDE Dev (Build web-main-11351-on-20130814)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 3 athompson 2013-08-15 15:34:59 UTC
Here you are. Note that this issue popped up at least a month or two (or three) ago in the development builds but I kept forgetting to file a report.


Product Version: NetBeans IDE Dev (Build 201308141142)
Java: 1.7.0_40-ea; Java HotSpot(TM) 64-Bit Server VM 24.0-b53
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b34
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/alvin/Library/Application Support/NetBeans/dev
Cache directory: /Users/alvin/Library/Caches/NetBeans/dev
Comment 4 athompson 2013-08-15 15:35:26 UTC
Same issue with JDK8
Comment 5 athompson 2013-08-15 16:05:23 UTC
also note that when I say regression from a "very long time ago" I'm talking years--possibly upwards of 10.
Comment 6 Vladimir Riha 2013-08-20 11:43:51 UTC
Thank you for update, I've tried it with Verdana font and still cannot reproduce it though

Product Version: NetBeans IDE Dev (Build 201308182300)
Updates: Updates available
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Mac OS X version 10.8.4 running on x86_64; UTF-8; en_US (nb)
Comment 7 athompson 2013-08-20 18:58:55 UTC
Hmm...I still have the same problem. I can replicate with Verdana in all sizes.  Maybe it has to do with being a retina mac?


Product Version: NetBeans IDE Dev (Build 201308192300)
Updates: Updates available
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b40
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/alvin/Library/Application Support/NetBeans/dev
Cache directory: /Users/alvin/Library/Caches/NetBeans/dev
Comment 8 athompson 2013-08-20 19:00:39 UTC
Created attachment 138944 [details]
settings dir
Comment 9 Vladimir Riha 2013-08-22 08:34:21 UTC
Do you have some older Mac without retina display or/and without OS X 10.9? If so, could you please try it on it?
Comment 10 athompson 2013-08-23 18:02:46 UTC
Unfortunately, I don't have another Mac I can test on ATM. I really think this should be a P2 because the "fake" spaces can alter the perceived meaning of the code in some syntaxes, which is very confusing.
Comment 11 David Strupl 2013-08-26 11:47:41 UTC
I have just tried the latest build of JDK 8 on MacOSX 10.8.4 and it looks ok with Verdana font. I am marking the problem as NO74 since we don't support OSX 10.9 yet. Also making the problem P2 since it looks really bad.
Comment 12 Miloslav Metelka 2013-09-04 08:44:37 UTC
Could you run the IDE with

-J-Dorg.netbeans.modules.editor.lib2.view.FontInfo.level=FINE

and attach messages.log? It should show the widths of the fonts being used by view hierarchy. Thanks.
Comment 13 maxnitribitt 2013-09-27 00:02:11 UTC
Created attachment 140524 [details]
same problem on my retina

I see the same problem with jdk7-u40 and nb 7.3.1
Comment 14 athompson 2013-09-27 01:54:58 UTC
(In reply to maxnitribitt from comment #13)
Hi Max,

Are you using OS X 10.8 or a Mavericks build?
Comment 15 maxnitribitt 2013-09-30 16:51:17 UTC
(In reply to athompson from comment #14)
> (In reply to maxnitribitt from comment #13)
> Hi Max,
> 
> Are you using OS X 10.8 or a Mavericks build?

Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b48
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b106
Comment 16 maxnitribitt 2013-09-30 16:53:30 UTC
(In reply to maxnitribitt from comment #15)
> (In reply to athompson from comment #14)
> > (In reply to maxnitribitt from comment #13)
> > Hi Max,
> > 
> > Are you using OS X 10.8 or a Mavericks build?
> 
> Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b48
> Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b106

Sorry, I wanted to write it also happens with JDK 8. I'm using OS X 10.8.5 (12F37)
Comment 17 athompson 2013-10-01 02:21:11 UTC
(In reply to David Strupl from comment #11)
> I have just tried the latest build of JDK 8 on MacOSX 10.8.4 and it looks ok
> with Verdana font. I am marking the problem as NO74 since we don't support
> OSX 10.9 yet. Also making the problem P2 since it looks really bad.

Hi, David, I'm removing the NO74 tag because the problem affects OS X 10.8 as well.
Comment 18 athompson 2013-10-01 02:23:50 UTC
...I imagine this must be a retina Mac issue since you're not seeing it.
Comment 19 David Strupl 2013-10-03 11:08:15 UTC
Stando, can you please try on your retina mac? Please try with 7u40 (or 45) and possibly also with JDK 8 (latest). If you are able to reproduce please include also the version of MacOSX that you have. Thanks a lot.
Comment 20 Stanislav Aubrecht 2013-10-03 12:50:39 UTC
I can reproduce that extra space in

Product Version: NetBeans IDE Dev (Build 20131002-81b450a5adc4)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)

While running on Retina MacBookPro
Comment 21 Stanislav Aubrecht 2013-10-03 12:59:34 UTC
But it seems to be a JDK bug as I can see the same artefacts in SwingSet demo app in the same environment.
Comment 22 Stanislav Aubrecht 2013-10-03 13:27:42 UTC
(In reply to Stanislav Aubrecht from comment #21)
> But it seems to be a JDK bug as I can see the same artefacts in SwingSet
> demo app in the same environment.

Please ignore comment #21, the HTML demo in SwingSet app is just poorly written so it looks like the bug is reproducible there.

But I can confirm the issue is visible in NetBeans under JDK 1.8 as well.

Product Version: NetBeans IDE Dev (Build 20131002-81b450a5adc4)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b51
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b109
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)
Comment 23 Salamander 2013-10-09 19:02:40 UTC
"me too" - confused the heck out of me at first, thought the 7.4 formatter had broken everything.

Retina MBP
OSX 10.8.5
java build 1.8.0-ea-b108
NB 7.4 RC2
Fonts: Monospaced 12, Monospaced 13.
Comment 24 Miloslav Metelka 2013-10-14 10:07:30 UTC
(In reply to Stanislav Aubrecht from comment #22)
> Please ignore comment #21, the HTML demo in SwingSet app is just poorly
> written so it looks like the bug is reproducible there.
> 
What concretely is poorly written?
 The demo just uses Swing's text package (JEditorPane) with html mime-type (the pane will use javax.swing.text.html.HTMLEditorKit). In the end either GlyphPainter1 or GlyphPainter2 are used for text glyphs rendering and IMHO both ways are legitimate and should be well supported by JDK.
Comment 25 Stanislav Aubrecht 2013-10-14 10:48:04 UTC
Created attachment 141055 [details]
Rendering issues
Comment 26 Stanislav Aubrecht 2013-10-14 10:48:20 UTC
(In reply to Miloslav Metelka from comment #24)
> (In reply to Stanislav Aubrecht from comment #22)
> > Please ignore comment #21, the HTML demo in SwingSet app is just poorly
> > written so it looks like the bug is reproducible there.
> > 
> What concretely is poorly written?
I meant that the HTML text content has unnecessary extra space characters so it looks like the issue can be reproduced.

But there's something broken in JDK. I've attached a screen shot of JLabel rendering this simple HTML: <html>plain text<i>itallics</i>more plain text

The top part is rendered on retina display, the bottom is rendered on the same machine on secondary non-retina display.
Comment 27 heintz 2013-10-25 11:55:14 UTC
I got this annoying font problem when I upgraded (i.e. installed) 7.3.1 on my mac.
I believe that I used the same JDK as with version 7.3 which lead me to believe it's a netbeans bug. But I might be wrong...
Comment 28 heintz 2013-10-27 07:16:50 UTC
Duplicate of https://netbeans.org/bugzilla/show_bug.cgi?id=234405.
Comment 29 heintz 2013-10-27 07:18:46 UTC
(In reply to heintz from comment #28)
> Duplicate of https://netbeans.org/bugzilla/show_bug.cgi?id=233541.

Sorry, https://netbeans.org/bugzilla/show_bug.cgi?id=233541
Comment 30 MrJxN 2013-11-04 17:43:36 UTC
Created attachment 141842 [details]
space after italics text in code editor

Same problem here, attached screenshot of issue.  MBP Retina 15" (early 2013).

Affects all languages (tried PHP, Java, jruby[with support plugin])

Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Mac OS X version 10.9 running on x86_64
Java; VM; Vendor = 1.7.0_45
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Comment 31 Miloslav Metelka 2013-11-14 12:32:00 UTC
We've tested with Standa on a Mac with retina display and it seemed that the issue is related to the two monitors being connected to the system (one retina and one non-retina). On non-retina the characters looked fine and on retina there was a gap. It looks to me like if the system would choose the largest metrics (so that the chars won't overwrite each other) on all present monitors and use that setting.
 Is there anyone who reproduces the problem and only uses a single retina display (no external monitors connected)?
 Anyway we'll continue to hunt the problem.
Comment 32 pron 2013-11-14 12:34:13 UTC
>  Is there anyone who reproduces the problem and only uses a single retina
> display (no external monitors connected)?

Yes, I'm only using my MBP 15" retina screen and the problem occurs.
Comment 33 athompson 2013-11-15 14:55:39 UTC
Same--just using the laptop without a second display.
Comment 34 ionuion 2013-11-18 01:19:34 UTC
Reproducible on retina Macbook Pro without external monitor.
Comment 35 Miloslav Metelka 2013-11-20 23:15:41 UTC
Added some more logging for
-J-Dorg.netbeans.modules.editor.lib2.view.ParagraphViewChildren.level=FINE
-J-Dorg.netbeans.modules.editor.lib2.view.TextLayoutUtils.level=FINE

http://hg.netbeans.org/jet-main/rev/e1537b6b28f7
Comment 36 Quality Engineering 2013-11-24 02:18:34 UTC
Integrated into 'main-silver', will be available in build *201311240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e1537b6b28f7
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #234405 - [Mac OSX w/ retina display] many fonts show a gap after italics - added logging.
Comment 37 Miloslav Metelka 2013-11-25 23:14:36 UTC
TextLayout.getPixelBounds() gives wrong result for italic fonts on retina displays. Luckily TextLayout.getAdvance() is correct so using that value.

http://hg.netbeans.org/jet-main/rev/1308aa7e0d17
Comment 38 athompson 2013-11-28 16:30:56 UTC
w00t!
Comment 39 Miloslav Metelka 2013-12-05 13:14:29 UTC
In release74:
e1537b6b28f7 transplanted to e00f76b4f60f
1308aa7e0d17 transplanted to 8c7352a46c58