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).

1  
srecord noeq G22LocalFontsPanel(G22Utils g22utils) is Swingable {
2  
  transient SingleComponentPanel scpFontDemo = singleComponentPanel();
3  
  transient JList fontsList;
4  
  transient S demoText = mlsUnindent([[
5  
    Gazelle
6  
    is a new
7  
    image recognizer
8  
  ]]);
9  
  
10  
  cachedVisualize {
11  
    var fontNames = localFontFamilies();
12  
    
13  
    fontsList = jlist(fontNames);
14  
    onSelect(fontsList, fontName -> {
15  
      if (fontName == null) ret with scpFontDemo.clear();
16  
      var font = localFont(fontName);
17  
      var renderText = new RenderText(font).fontSize(50)
18  
        .alignment("center");
19  
      scpFontDemo.set(jCenteredSection("Font Demo: " + fontName,
20  
        jscroll_center(g22utils.stdImageSurface(renderText.get(demoText)))));
21  
    });
22  
    
23  
    ret jCenteredRaisedSection("Local Fonts",
24  
    jhsplit(0.3,
25  
      jCenteredSection(n2(fontNames, "Font"), fontsList),
26  
      scpFontDemo);
27  
  }
28  
}

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: 201 / 343
Version history: 8 change(s)
Referenced in: [show references]