EditorViewHierarchyFontsRendering

(Difference between revisions)
Mmetelka (Talk | contribs)
(Created page with '=== Rendering of Fonts by View Hierarchy === Editor View Hierarchy uses <tt>java.awt.font.TextLayout</tt> for text representation and rendering. View hierarchy just calls approp…')
Newer edit →

Revision as of 14:13, 4 December 2012

Rendering of Fonts by View Hierarchy

Editor View Hierarchy uses java.awt.font.TextLayout for text representation and rendering. View hierarchy just calls appropriate methods for measuring and rendering of the TextLayout objects. For more information about character measurements the IDE may be run with

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

which will dump font information to console.

Multiple Fonts

For multiple fonts used (including just bold and italic variants of a single font) multiple TextLayout instances will be used. Boundaries between them may generate extra visual gaps especially when an italic font gets used (even if overall italic characters have a width equal to non-italic characters for the given font): image:font-widths.png

Note that '=' for static field is little shifted against non-static field's '=' due to italic font being used for static field. This is because one TextLayout instance is not able to use layout information from the end of a TextLayout instance that precedes it (and possibly shift itself visually closer to the preceding instance). Although it looks like "monospaced font is not monospaced" it's beyond scope of NetBeans View Hierarchy's code to improve the situation. When this issue occurs either a different font may be attempted by the user (where the problem would not be so visible) or a single font type needs to be used.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo