Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #1000994 // loadFont - load Java font (.ttf/.otf) from a snippet or file

JavaX fragment (include)

static Font loadFont(S snippetID) ctex {
  return loadFont(snippetID, 12f);
}

static Font loadFont(InputStream in) ctex {
  return Font.createFont(Font.TRUETYPE_FONT, in);
}

static Font loadFont(S snippetID, float fontSize) {
  ret loadFont(loadLibrary(snippetID), fontSize);
}

static Font loadFont(File f, float fontSize) ctex {
  return Font.createFont(Font.TRUETYPE_FONT, f).deriveFont(fontSize);
}

static Font loadFont(InputStream in, float fontSize) ctex {
  return Font.createFont(Font.TRUETYPE_FONT, in).deriveFont(fontSize);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lnbujpyubztb, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1000994
Snippet name: loadFont - load Java font (.ttf/.otf) from a snippet or file
Eternal ID of this version: #1000994/5
Text MD5: b56b1b47c5fdba248439ec3ab5115005
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-30 20:22:06
Source code size: 556 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 710 / 1273
Version history: 4 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1004610 - loadFont_cached (accepts snippet ID)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)