Java Font Text Height stringHeight(Graphics2D g2d)

Here you can find the source of stringHeight(Graphics2D g2d)

Description

string Height

License

Open Source License

Declaration

public static int stringHeight(Graphics2D g2d) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.FontMetrics;
import java.awt.Graphics2D;

public class Main {
    public static int stringHeight(Graphics2D g2d) {
        FontMetrics fm = g2d.getFontMetrics(g2d.getFont());

        return fm.getHeight();
    }// w w w  . j  av  a 2  s. co m
}

Related

  1. getStringHeight(Component c)
  2. getStringHeight(Graphics2D g, String str)
  3. getStringHeight(Graphics2D graphics2D)
  4. getTextHeight(String s, FontMetrics fm, Graphics g)
  5. getTextHeight(String text, Graphics g, String newLineSplit)