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 146555 - Setting for "Line Height Correction"
Summary: Setting for "Line Height Correction"
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 5 votes (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-08 18:23 UTC by Masaki Katakai
Modified: 2011-11-08 06:51 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Weird line height issue (set to 0.6) (23.42 KB, text/plain)
2009-02-10 20:58 UTC, cjunge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2008-09-08 18:23:20 UTC
Hi Editor team,

I'm asked from community folks how to customize some settings about
editor e.g. "Line Height Correction" on 6.5, these detail editor options could be
customized before on advanced option.

When I checked the UI spec, http://ui.netbeans.org/docs/ui/options2/,
"Line Height Correction" will be on "Advanced" tab of Editor option,
but currently it's not provided. Will this be implemented?

I'm sorry I could not find the exact bug report for this, if it has been
already filed, please mark this bug report as dup of the original one.

Thanks.
Comment 1 Jiri Prox 2008-09-09 08:32:06 UTC
there is temporal workaround available:

add following code to the file:
{userdir}/config/Editors/text/x-java/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml

    <entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
        <value><![CDATA[2.0]]></value>
    </entry>


Comment 2 Vitezslav Stejskal 2008-09-09 10:29:18 UTC
Masaki, why exactly do they need to customize this?
Comment 3 Masaki Katakai 2008-09-09 10:35:47 UTC
Thanks for evaluation and workaround.

OK, I'll ask them to add their comments here.
Comment 4 Vitezslav Stejskal 2008-09-09 11:05:58 UTC
Oh, as for the workaround it might be better to use the 'all languages' file, which is:
{userdir}/config/Editors/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml
Comment 5 Masaki Katakai 2008-09-10 04:33:01 UTC
Btw, any reasonable reference for these preference key and value?

I found these docs but if you have, please let me know.

http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-settings/constant-values.html
http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-settings/org/netbeans/api/editor/settings/SimpleValueNames.html
Comment 6 nhelder 2009-01-07 00:08:16 UTC
vstejskal,

For whatever it's worth, my experience is that line height correction is most useful when reducing font sizes. For
example, if you adjust the default font to monospaced 11 (or 10), you'll see that the amount of white space between the
lines increases noticeably.

For my eyes - at 1900x1200 - monospaced 11 with a 0.8 correction is about right.

Presumably the line height correction feature would also be useful if people are running at different resolutions and
adjusting the font to be even smaller (or larger) than default.

Anyway, thanks for the temporary fix!

  - Nathan
Comment 7 cjunge 2009-02-10 20:57:38 UTC
I'm having a similar issue, not sure if it's related. I'm on Ubunbtu 8.10, and using the dev builds (currently
200902091451).

My line height changed after build 200901061401, without any actual changes to my system. The size seemed to double,
resulting in a lot of space between the lines, while still having the same font size.

I've done the suggested change below, but this has made the editor look weird. Now a highlighted line is only 1/2
height, with a lot space below the line. Editing text results in the text being cut off the top, which comes right after
I stop typing.

It seems to me that the line height calculation is confused as to what the actual font text height is. ANy help would be
appreciated. I've attached a screen shot to this issue.

Cheers, Cameron.
Comment 8 cjunge 2009-02-10 20:58:30 UTC
Created attachment 76821 [details]
Weird line height issue (set to 0.6)
Comment 9 cjunge 2009-03-24 04:04:35 UTC
Ok, an additional note... my line issue seemed to be due to use OpenJDK instead of the official Sun JDK.
Comment 10 smokindoug 2010-06-28 13:39:26 UTC
I'm having a problem related to this on Linux:
(
Product Version: NetBeans IDE 6.9 (Build 201006101454)
Java: 1.6.0_20; Java HotSpot(TM) 64-Bit Server VM 16.3-b01
System: Linux version 2.6.22.14-72.fc6 running on amd64; ISO-8859-1; en_CA (nb)
Userdir: /var/local/space/.netbeans/6.9

Redhat Fedora 3.5.8
)

Whenever I add this "entry" tag to a "CustomPreferences.xml" file manually, I end up with a non-bootable NetBeans installation. I get the following exception in "messages.log"

(
java.lang.UnsatisfiedLinkError: no splashscreen in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1028)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.SplashScreen.getSplashScreen(SplashScreen.java:91)
        at org.netbeans.core.startup.Splash.<init>(Splash.java:140)
        at org.netbeans.core.startup.Splash.getInstance(Splash.java:103)
        at org.netbeans.core.startup.Main.start(Main.java:291)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:114)
        at java.lang.Thread.run(Thread.java:619)
)


This appears to occur after I access "Editor" from the Options and exit NetBeans (presumably causing option files to be written). I have to delete my .netbeans directory to be able to reboot NetBeans.

I have not seen these problems on Windows (7-64, XP-32).
Comment 11 Vitezslav Stejskal 2010-06-28 14:33:51 UTC
IMO this exception is unrelated to the original problem and I'm not sure what is causing the problem. I'm passing this to the module system owners, who might know more. Please pass it back the editor when fixed or if the fix has to be done in the editor somehow. Thanks
Comment 12 Jesse Glick 2010-06-28 17:57:41 UTC
smokindoug's problem sounds completely unrelated and should not be filed here. Create a separate issue with a complete description of how to reproduce. Passing back to editor for original problem, whatever that was.
Comment 13 Vitezslav Stejskal 2010-06-29 07:53:15 UTC
smokindoug, could you please file a separate report for 'Platform/Module System' and provide a step by step guidance on how to reproduce the problem. The exception seems to be a problem in loading resources (classloaders, modules, etc) and is not related to the original problem reported here (ie. no ui for customizing 'line height correction' setting). Thanks a lot.
Comment 14 smokindoug 2010-06-29 19:58:15 UTC
Bug188217 opened...
Comment 15 shunbul 2011-04-29 02:52:36 UTC
Will this setting ever find its way into the options dialog?  It's an important setting when using non-standard fonts and/or sizes.
Comment 16 Miloslav Metelka 2011-10-20 09:21:58 UTC
Sorry, but we do not plan to add a visual setting for Line Height Correction. Please use
{userdir}/config/Editors/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml

Sample of the file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE editor-preferences PUBLIC "-//NetBeans//DTD Editor Preferences 1.0//EN" "http://www.netbeans.org/dtds/EditorPreferences-1_0.dtd">
<editor-preferences>
    <entry javaType="java.lang.String" name="text-line-wrap" xml:space="preserve">
        <value><![CDATA[words]]></value>
    </entry>
    <entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
        <value><![CDATA[1.2]]></value>
    </entry>
</editor-preferences>

I have fixed issue 200942 yesterday so it should work fine now with the current view hierarchy.
Comment 17 tusharvjoshi 2011-11-08 06:51:49 UTC
The workaround given in this issue is no longer working in NetBeans IDE 7.0 onwards.  May I open this issue or file a new one?