Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 764 Bytes

README_en.md

File metadata and controls

33 lines (22 loc) · 764 Bytes

FontMetrics for GWT \囧/

This project re-writes FontMetrics in pure GWT. It is almost the same as the original design, but with a more Java style approach. 💃

Usage

Maven

<dependency>
	<groupId>us.dontcareabout</groupId>
	<artifactId>FontMetrics</artifactId>
	<version>0.0.1</version>
</dependency>

At this monent, it doesn't exist on Maven Repository, so please do mvn install yourself. 🈚

Code

//If the browser doesn't support Canvas, it will throw an UnsupportedOperationException.
FontMetrics fm = FontMetrics.get(new Font("Times", "normal", 200));

double ascent = fm.getAscent();	//the ratio of font size