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

28
LINES

< > BotCompany Repo | #1034603 // G22LocalFontsPanel

JavaX fragment (include) [tags: use-pretranspiled]

Uses 1485K of libraries. Click here for Pure Java version (41298L/274K).

srecord noeq G22LocalFontsPanel(G22Utils g22utils) is Swingable {
  transient SingleComponentPanel scpFontDemo = singleComponentPanel();
  transient JList fontsList;
  transient S demoText = mlsUnindent([[
    Gazelle
    is a new
    image recognizer
  ]]);
  
  cachedVisualize {
    var fontNames = localFontFamilies();
    
    fontsList = jlist(fontNames);
    onSelect(fontsList, fontName -> {
      if (fontName == null) ret with scpFontDemo.clear();
      var font = localFont(fontName);
      var renderText = new RenderText(font).fontSize(50)
        .alignment("center");
      scpFontDemo.set(jCenteredSection("Font Demo: " + fontName,
        jscroll_center(g22utils.stdImageSurface(renderText.get(demoText)))));
    });
    
    ret jCenteredRaisedSection("Local Fonts",
    jhsplit(0.3,
      jCenteredSection(n2(fontNames, "Font"), fontsList),
      scpFontDemo);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034603
Snippet name: G22LocalFontsPanel
Eternal ID of this version: #1034603/9
Text MD5: 744bd7867433c1ce6f6bf4cd30f73078
Transpilation MD5: 31308c6bd363b341b1f55c9c97c8750c
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-28 03:06:07
Source code size: 912 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 98 / 204
Version history: 8 change(s)
Referenced in: [show references]