How to get the real height of a character (fontmetrics/graphics2d) -


I currently need to get the actual height of a character. I know about functions like getDecsent (), getAscent () ... but they only allow to obtain value in relation to hole font (in this context). I also tried to use GetStringBounds (), but this is the same story.

Like the title, I am looking for a way to get the height value of only one four at a time.

For example 'N' is more then 'N', 'I' is a bit higher then 'I' and so on

Thanks for your time

use this

  Rectangle2D bounds = font.getStringBounds ("here's your string Apply ", context); // font which you want, can be set / / My suggestion is that you use the same font for both characters / context font // Instead of printing it you can do it another time and compare 2 strings    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -