[ https://issues.apache.org/jira/browse/NETBEANS-2463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16826074#comment-16826074 ]
Michal Pudivitr edited comment on NETBEANS-2463 at 4/25/19 2:02 PM: -------------------------------------------------------------------- So, it might be enough just to replace the line 317 in HtmlPrintContainer.java (package org.netbeans.modules.editor) {code:java} sb.append (font.getFamily()); //TODO: Locale should go here {code} with the {code:java} switch(font.getFamily()) { case Font.MONOSPACED: sb.append ("monospace"); break; case Font.SERIF: sb.append ("serif"); break; case Font.SANS_SERIF: sb.append ("sans-serif"); break; case Font.DIALOG: sb.append ("serif"); break; case Font.DIALOG_INPUT: sb.append ("monospace"); break; default: sb.append (font.getFamily()); //TODO: Locale should go here } {code} + maybe introducing these strings as statics to the beginning of the file. Unfotunately, I can't test it now and I am not much familiar with the process of pulling / submitting the edits. was (Author: michalp): So, it might be enough just to replace the line 317 in HtmlPrintContainer.java (package org.netbeans.modules.editor) {code:java} sb.append (font.getFamily()); //TODO: Locale should go here {code} with the {code:java} switch(font.getFamily()) { case Font.MONOSPACED: sb.append ("monospace"); break; case Font.SERIF: sb.append ("serif"); break; case Font.SANS_SERIF: sb.append ("sans-serif"); break; case Font.DIALOG: sb.append ("serif"); break; case Font.DIALOG_INPUT: sb.append ("monospace"); break; default: sb.append (font.getFamily()); //TODO: Locale should go here } {code} + maybe introducing these strings as statics to the beginning of the file. Unfotunately, I can't test it now and I am not much familiar with the process of pulling / submitting the edits. > Print to HTML - wrong font-family > --------------------------------- > > Key: NETBEANS-2463 > URL: https://issues.apache.org/jira/browse/NETBEANS-2463 > Project: NetBeans > Issue Type: Bug > Components: editor - Painting & Printing > Affects Versions: 8.2, 9.0, 10.0, 11.0 > Environment: Windows > Reporter: Michal Pudivitr > Priority: Trivial > > Using File > Print to HTML will produce HTML with misspelled font family > (font-family: Monospace{color:#d04437}*d*{color} instead of "monospace"). The > result is rendered with the browser's default (non-monospace) font. > Steps to reproduce: > # Create or open any java file > # go to File > Print to HTML > Print to file > # open generated HTML file (result will not be rendered with proper font > due to wrong font-family) > # (optional) edit html file replacing all occurrences of "monospace*d*" with > "monospace" and see the file is now rendered correctly. > It seems this minor bug was already reported in year 2013 under [Bug > 236506|https://netbeans.org/bugzilla/show_bug.cgi?id=236506] but the ticked > was closed unresolved. > Refer to [https://www.w3.org/Style/Examples/007/fonts] for more about font > families. > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists