fonts - Alternative of FontMetrics in Java -
My code uses getFontMetrics () which dislikes. What can be optional?
Public Zero Set Font (font font) {if (font == null) {font defaultFont = (font) javax.swing.UIManager.getDefaults (). "Label.fonts"); Font = new font (defaultFont.getName (), font .BOLD, defaultFont.getSize () + 8) ;; } Font Metrics Font Metrics = Toolkit.Get Default Toolkit (). GetFontMetrics (font); FontHeight = fontMetrics.getHeight (); FontDescent = fontMetrics.getDescent (); FontLeading = fontMetrics.getLeading (); If (text! = Null) fontWidth = Toolkit.getDefaultToolkit () GetFontMetrics (font). Stringing (text); CurrentFont = font; Superset font (font); } Any suggestions?
Javadoc tells you
According to JDK version 1.2, the font method Has been replaced by getLineMetrics.
Comments
Post a Comment