TransWikia.com

How can I display all fonts on one screen size?

Mathematica Asked on April 6, 2021

I want to test the font like this. On my machine, there are 270 fonts but I can’t not display them all one one screen size so I can only print each time 50 fonts. How can I display it as in the image below?

fontlist = FE`Evaluate[FEPrivate`GetPopupList["MenuListFonts"]];
Panel@Row[fontlist[[1 ;; 50]] /.
   Rule[x_, y_] :> 
    Style[ToString@"Font Test  - " <>   x  , 14, FontFamily -> y], "  
     [FilledSquare] " "n"] 

enter image description here

One Answer

Panel @ 
 Multicolumn[Row[{"■ ", #}] & /@ (fontlist[[1 ;; 50]] /. 
     Rule[x_, y_] :> Style[ToString@"Font Test  - " <> x, 14, FontFamily -> y]),
   3, Appearance -> "Horizontal"]

enter image description here

Panel @ 
 Multicolumn[Row[{"■ ", #}] & /@ 
     (fontlist[[1 ;; 50]] /. Rule[x_, y_] :> 
      Style[ToString@"Font Test  - " <> x, 14, FontFamily -> y]), 
  3, Appearance -> "Horizontal", Spacings -> {1, 1}, 
  Background -> {{{LightBlue, LightOrange}}, Automatic}, 
  Frame -> All, FrameStyle -> White]

enter image description here

You can also Partition the input list and use Grid. If you use Scaled when setting the option ItemSize column widths will automatically adjust to the available window width:

Panel @ Grid[Partition[Row[{"■ ", #}] & /@ 
   (fontlist[[1 ;; 50]] /. Rule[x_, y_] :> 
       Style[ToString@"Font Test  - " <> x, 14, FontFamily -> y]), 
    2, 2, {1, 1}, {}],
  Alignment -> {Left, Center}, 
  ItemSize -> {Scaled[1/2], Automatic}, Spacings -> {1, 1}, 
  Background -> {{{LightBlue, LightOrange}}, Automatic},
  Frame -> All, FrameStyle -> White]

enter image description here

Correct answer by kglr on April 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP