FontMenu.st
changeset 5270 0f4a11512bef
parent 5269 f92fea8b5c9e
child 5678 81c653d39f49
child 6259 e37c6e062e3e
--- a/FontMenu.st	Tue Oct 11 16:23:27 2016 +0200
+++ b/FontMenu.st	Tue Oct 11 16:33:41 2016 +0200
@@ -687,24 +687,37 @@
 !FontMenu methodsFor:'menu spec'!
 
 symbolicFontsMenu
-    |symbolicFontSelectors selectors menu menuLabels menuItems|
+    |symbolicFontSelectors bigFontSelectors smallFontSelectors normalFontSelectors
+     selectors menu menuLabels menuItems|
 
     symbolicFontSelectors := (applicationClass methodsWithAnyResource:#(fontSpec)) 
                                 collect:[:each| each selector].
 
+    bigFontSelectors := (symbolicFontSelectors select:[:nm | nm endsWith:'Big']) sort.                            
+    smallFontSelectors := (symbolicFontSelectors select:[:nm | nm endsWith:'Small']) sort.                            
+    normalFontSelectors := (symbolicFontSelectors reject:[:nm | nm endsWithAnyOf:#('Small' 'Big')]) sort. 
     symbolicFontSelectors :=
-        (symbolicFontSelectors reject:[:nm | nm endsWith:'Small']) sort
-        , (symbolicFontSelectors select:[:nm | nm endsWith:'Small']) sort.
+        normalFontSelectors , #(nil) , smallFontSelectors , #(nil) , bigFontSelectors.    
 
-    selectors := Array new:symbolicFontSelectors size withAll:#fontSymbol:.
-    menuLabels := symbolicFontSelectors, #('-' 'Other...').
-    selectors := selectors, #(nil launchFontSymbolDialog).
+    selectors := (Array new:normalFontSelectors size withAll:#fontSymbol:)
+                 , #( nil )
+                 , (Array new:smallFontSelectors size withAll:#fontSymbol:)
+                 , #( nil )
+                 , (Array new:bigFontSelectors size withAll:#fontSymbol:)
+                 , #(nil launchFontSymbolDialog).
+                 
+    menuLabels := normalFontSelectors 
+                  , #('-') 
+                  , smallFontSelectors 
+                  , #('-') 
+                  , bigFontSelectors 
+                  , #('-' 'Other...').
 
     menu := Menu labelArray:menuLabels values:selectors.
     menuItems := menu items.
     symbolicFontSelectors keysAndValuesDo:[:eachIndex :eachFontSelector|
         |font|
-        font := applicationClass resolveFont:eachFontSelector.
+        eachFontSelector notNil ifTrue:[ font := applicationClass resolveFont:eachFontSelector ].
         font notNil ifTrue:[
             (menuItems at:eachIndex) font:font.
         ].
@@ -795,7 +808,7 @@
     |string|
 
     string := EnterBox 
-                request:(resources string:'Symbol:')
+                request:(resources string:'Symbol (message to app, which returns the font):')
                 initialAnswer:(self fontSymbol).
 
     string notEmptyOrNil ifTrue:[