Libraryless. Click here for Pure Java version (6206L/37K).
1 | static FontMetrics fontMetrics(S fontSnippetID, float fontSize) { |
2 | ret fontMetrics(loadFont_cached(fontSnippetID, fontSize)); |
3 | } |
4 | |
5 | static FontMetrics fontMetrics(Font font) { |
6 | BufferedImage dummyImg = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); |
7 | Graphics g = antiAliasGraphics(dummyImg); |
8 | g.setFont(font); |
9 | ret g.getFontMetrics(); |
10 | } |
11 | |
12 | static FontMetrics fontMetrics(Graphics g) { |
13 | ret g?.getFontMetrics(); |
14 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006845 |
Snippet name: | fontMetrics |
Eternal ID of this version: | #1006845/3 |
Text MD5: | ec7078e71ede89b194f890559985eef3 |
Transpilation MD5: | 606bff20d26699c27c007b520c62e2ba |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-10 16:33:15 |
Source code size: | 432 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 563 / 642 |
Version history: | 2 change(s) |
Referenced in: | [show references] |