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 220506 - Clipped fonts
Summary: Clipped fonts
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-21 13:46 UTC by java_dev
Modified: 2012-12-05 15:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
picture of characters clipped at 18pt (60.61 KB, image/jpeg)
2012-10-21 13:46 UTC, java_dev
Details
Aharoni 48 pts on same line as "normal " 12 pt text. (11.30 KB, image/png)
2012-12-04 20:22 UTC, java_dev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description java_dev 2012-10-21 13:46:52 UTC
Created attachment 126260 [details]
picture of  characters clipped at 18pt

Netbeans permits the use of different sized fonts for different programming language  elements and  this is one of Netbeans best and most distinguishing features.  However, in the 7.3 release, there is a bug with respect to rendering variable sized fonts within a single file. 

It appears that Netbeans is using some calculation of line height and or drawing clip region (in the IDE editor , in this case I am using the Java editor) which is based on insufficient information, specifically it appears it's basing it's calculation  on the default font size only. 

So every line is rendered as though its line height were the same. But the line heights which contain characters with larger fonts are actually higher than the ones which only contain default font sized characters. 

So the effect is, those  lines which contain characters using  larger fonts get their characters clipped off to the default line height, making those lines appear cut off from the top and unreadable.  

I have enclosed a jpg which illustrates the issue. 

In 7.2 , the behavior was different in a informative way. In 7.2, the line height appeared to be set to the largest font used in the file. The effect there was, everything rendered correctly, but the space *between* the lines was also set to the largest font's height, so you ended up with a lot of space between each line of code. 

I used to use Intellij and in that editor they permitted the line spacing (the empty space between two lines  of code) to be manually adjusted in a config file to be something like "1.3" or "1.5" or "2.0" which would represent double line spacing. 

Assuming the 7.2 and 7.3  situations represent a necessary (because of a bug in Swing's editor library)  engineering trade-off of some sort and not just an outright  Netbeans bug, if you went back to the 7.2 way of rendering but added the ability to tweak line spacing independently, then the end user could find some happy compromise between clipped text and too-big line spacing. 

My own solution in 7.2 was to not make the font as large as I wanted (I wanted 24 pt) for  elements in order to keep  the line spacing acceptable.

If I had to choose between the two, I'd rather have 7.2 rendering than 7.3 because at the cost of some extra white-space, I can still use the variable font size feature which is extremely useful to me. 

HTH and GREAT product BTW. I am new to NB and the IDE is just fantastic and especially the highly rationalized, well documented plugin framework is extraordinarily valuable to me. 

Cheers.
Comment 1 revisionzero 2012-10-25 10:16:33 UTC
Yup, fonts are larger(first thing I noticed when I launched 7.3 beta). My font size is set to 14pt in both 7.2 and 7.3 installations, and I seemed to have lost view of a couple lines of code in the editor (Vertical real estate).

Haven't seen fonts being clipped yet, maybe that's because I'm using a smaller font size.

Hope you guys can fix this before the official 7.3 release!

thanks,

RZ
Comment 2 java_dev 2012-12-04 20:22:41 UTC
Created attachment 128858 [details]
Aharoni 48 pts on same line as "normal " 12 pt text.

Fixed! Aharoni 48 pts!
Comment 3 Miloslav Metelka 2012-12-05 14:54:56 UTC
So I marked the issue as fixed.
I've introduced additional TextLayout measurements as part of fix of issue #215785 (and there were some minor fixes later). There's still a remaining issue #219291 to be fixed. Btw to display a detailed font measurements info a command line parameter

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

may be used when running the IDE.
Comment 4 java_dev 2012-12-05 15:46:08 UTC
Miloslav,
 OK I downloaded 7.2 and it updated itself so that it is current as of this posting. After the update, it regressed , that is, if you had fixed it in 7.2. But I think maybe it's fixed in 7.3 and not 7.2. Is that correct? Also, I am not sure what this is:

 Btw to display a detailed font measurements info a
command line parameter

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

may be used when running the IDE.

Does this output some read-only info to output or does it enable a new set of options in the Options dialog or what? 

Thank you for looking at this, I use this feature heavily and I know a lot of other people probably do also.