Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (
- var updateFont,size = 100;
- w = Window("Mapa de caracteres", Rect(20, Window.screenBounds.height - 500, 600, 400),scroll:true).front;
- w.view.decorator = FlowLayout(w.view.bounds);
- StaticText.new(w, Rect(5, 0, 30, 20)).string_("Font").align_(\right);
- m = PopUpMenu(w, Rect(40, 0, 250, 20));
- m.items = Font.availableFonts;
- StaticText.new(w, Rect(290, 0, 28, 20)).string_("Size").align_(\right);
- y = PopUpMenu(w, Rect(322, 0, 50, 20));
- y.items = Array.series(100,20,10);
- w.view.decorator = FlowLayout( w.view.bounds, 0@40, size@size );
- //Iteraciones para el mapa de caracteres
- t=255.do{ |i|
- var t,font="Arial";
- t=[i, (i.asAscii).asCompileString];
- StaticText( w.view,(size*3)@(size*2) ).string_(if (t.asString.contains(".asAscii")==true,{t[0]},{(t.asString).replace("$","").replace("[","").replace("]","").replace("\,","").replace("\\","")})).font_(Font(font,size)) };
- //Si le cambio al tipo de letra
- y.action = {
- var font;
- font = Font(m.items[m.value],y.items[y.value].asInteger);
- t=255.do{ |i|
- var t;
- t=[i, (i.asAscii).asCompileString];
- StaticText( w.view,(size*3)@(size*2) ).string_(if (t.asString.contains(".asAscii")==true,{t[0]},{(t.asString).replace("$","").replace("[","").replace("]","").replace("\,","").replace("\\","")})).font_(font) };
- };
- //Si le cambio el tamaño
- m.action = y.action;
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement