3
$\begingroup$

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

$\endgroup$
7
$\begingroup$
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

$\endgroup$
1
  • $\begingroup$ really nice I should learn more about Multicolumn $\endgroup$ – anhnha Feb 1 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.