Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong size returned by FontMetrics.stringWidth(String s) on devic…
…es that use skia when loading font ending with name ending with .ttf (#50) Font.getFont("Fonts/Roboto-Bold.ttf", false, size) leads FontMetrics.stringWidth(String s) to returns almost double of the size of the font. The reason this is happening is because on the vm side it already adds .ttf the end of the name of the font making the vm look for Fonts/Roboto-Bold.ttf.ttf instead of the originally passed argument. To solve this, I check if name of the font already come with .ttf before concatenating .ttf to the of the name.
- Loading branch information