--- a/editor.completion/src/org/netbeans/modules/editor/completion/DocumentationScrollPane.java Wed Feb 22 06:03:52 2017 +0000 +++ b/editor.completion/src/org/netbeans/modules/editor/completion/DocumentationScrollPane.java Fri Nov 03 12:17:40 2017 -0400 @@ -81,6 +81,7 @@ * @author Martin Roskanin, Dusan Balek */ public class DocumentationScrollPane extends JScrollPane { + private static final String TEXT_ZOOM_PROPERTY = "text-zoom"; // Defined in DocumentView in editor.lib2 private static final String BACK = "org/netbeans/modules/editor/completion/resources/back.png"; //NOI18N private static final String FORWARD = "org/netbeans/modules/editor/completion/resources/forward.png"; //NOI18N @@ -130,6 +131,17 @@ // Add the completion doc view view = new HTMLDocView(bgColor); + Integer textZoom = (Integer) editorComponent.getClientProperty(TEXT_ZOOM_PROPERTY); + // Use the same logic as in o.n.editor.GlyphGutter.update(). + if (textZoom != null && textZoom != 0) { + Font font = view.getFont(); + if (Math.max(font.getSize() + textZoom, 2) == 2) { + textZoom = -(font.getSize() - 2); + } + view.setFont(new Font(font.getFamily(), font.getStyle(), + font.getSize() + textZoom)); + } + view.addHyperlinkListener(new HyperlinkAction()); setViewportView(view); --- a/editor.completion/src/org/netbeans/modules/editor/completion/HTMLDocView.java Wed Feb 22 06:03:52 2017 +0000 +++ b/editor.completion/src/org/netbeans/modules/editor/completion/HTMLDocView.java Fri Nov 03 12:19:35 2017 -0400 @@ -46,6 +46,7 @@ package org.netbeans.modules.editor.completion; import java.awt.Color; +import java.awt.Font; import java.awt.Insets; import java.awt.Rectangle; import java.awt.event.MouseEvent; @@ -194,12 +195,14 @@ private void setBodyFontInCSS() { javax.swing.text.html.StyleSheet css = new javax.swing.text.html.StyleSheet(); - java.awt.Font f = new EditorUI().getDefaultColoring().getFont(); - setFont(f); + java.awt.Font editorFont = new EditorUI().getDefaultColoring().getFont(); + // do not use monospaced font, just adjust fontsize + Font useFont = + new Font(getFont().getFamily(), Font.PLAIN, editorFont.getSize()); + setFont(useFont); try { - css.addRule(new StringBuilder("body, div { font-size: ").append(f.getSize()) // NOI18N - .append("; font-family: ").append(getFont().getFamily()).append(";}").toString()); // NOI18N - // do not use monospaced font, just adjust fontsize + css.addRule(new StringBuilder("body, div { font-size: ").append(useFont.getSize()) // NOI18N + .append("; font-family: ").append(useFont.getFamily()).append(";}").toString()); // NOI18N } catch (Exception e) { } css.addStyleSheet(htmlKit.getStyleSheet());