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 262855

Summary: Print to HTML generates invalid font size due to no 'px' suffix
Product: editor Reporter: SiddheshRane
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Opera 38 inspector shows font size as invalid
font size fixed after adding px suffix
What the file looks like in the editor, for reference

Description SiddheshRane 2016-07-18 14:39:05 UTC

    
Comment 1 SiddheshRane 2016-07-18 14:41:20 UTC
Created attachment 160428 [details]
Opera 38 inspector shows font size as invalid
Comment 2 SiddheshRane 2016-07-18 14:42:25 UTC
Created attachment 160429 [details]
font size fixed after adding px suffix
Comment 3 SiddheshRane 2016-07-18 14:43:31 UTC
Created attachment 160430 [details]
What the file looks like in the editor, for reference
Comment 4 SiddheshRane 2016-07-18 15:46:48 UTC
When the Print To HTML action generates styles for non default font sizes, it skips the px suffix that is required by modern browsers. Without the suffix the font size gets ignored by the browser. This has been tested on Opera 38 as well as Firefox 46; Chrome should be similar as Opera is based on it.

The fix lies in the file editor/src/org/netbeans/modules/editor/HtmlPrintContainer.java
(http://hg.netbeans.org/main/file/186d1d9ef175/editor/src/org/netbeans/modules/editor/HtmlPrintContainer.java) on line 355. It will take me some time to generate a patch.