Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / SCClassLibrary / Common / GUI / iphone / Base / SCFont.sc
blobeb854874d5b17d0a9bad7be1fc7afbf2d00e3830
1 SCFont {
2         classvar <>default;
3         var <>name, <>size;
5         *new { arg name, size;
6                 ^super.newCopyArgs(name, size);
7         }
8         setDefault { default = this }
10         *availableFonts {
11                 // returns an Array of font names.
12                 _Font_AvailableFonts
13                 ^this.primitiveFailed
14         }
15         *antiAliasing_ { arg flag = false;
16                 _Font_SetAntiAliasing;
17                 ^this.primitiveFailed
18         }
19         *smoothing_ { arg flag = false;
20                 _Font_SetSmoothing;
21                 ^this.primitiveFailed
22         }
23         storeArgs { ^[name,size] }
25         boldVariant {
26                 ^if( name.endsWith( "-Bold" ), this, { this.class.new( name ++ "-Bold", size )});
27         }
29         *defaultSansFace {
30                 ^"Helvetica";
31         }
33         *defaultSerifFace {
34                 ^"Times";
35         }
37         *defaultMonoFace {
38                 ^"Monaco";
39         }
41         *monospace {|size|
42                 ^this.new(this.defaultMonoFace, size)
43         }
45         *serif {|size|
46                 ^this.new(this.defaultSerifFace, size)
47         }
49         *sansSerif {|size|
50                 ^this.new(this.defaultSansFace, size)
51         }