old quark gui: openOS is not osx only
[supercollider.git] / SCClassLibrary / QtCollider / QFont.sc
blobf11da89d53ba79ab7a9e3706521fb2ceb4f204df
1 QFont {
2   classvar defaultSansFace, defaultSerifFace, defaultMonoFace;
3   var <>name, <size, <>bold, <>italic, <hasPointSize=false;
4   /* ----------------- class -------------------*/
6   *initClass {
8   }
10   *new { arg name, size, bold = false, italic = false, usePointSize = false;
11     ^super.newCopyArgs( name, size, bold, italic, usePointSize );
12   }
14   *availableFonts {
15     _Qt_AvailableFonts
16   }
18   *antiAliasing_ { arg flag;
19   }
21   *smoothing_ { arg flag;
22   }
24   *defaultSansFace {
25     ^"sans-serif";
26   }
28   *defaultSerifFace {
29     ^"serif";
30   }
32   *defaultMonoFace {
33     ^"monospace";
34   }
36   *default {
37     ^QFont();
38   }
40   *monospace {|size, bold = false, italic = false, usePointSize = false|
41      ^this.new(this.defaultMonoFace, size, bold, italic, usePointSize)
42   }
44   *serif {|size, bold = false, italic = false, usePointSize = false|
45      ^this.new(this.defaultSerifFace, size, bold, italic, usePointSize)
46   }
48   *sansSerif {|size, bold = false, italic = false, usePointSize = false|
49      ^this.new(this.defaultSansFace, size, bold, italic, usePointSize)
50   }
52   /* ------------------instance------------------*/
54   setDefault {
55   }
57   boldVariant {
58     ^this.class.new( name, size, true, italic );
59   }
61   size_ { arg pixelSize; this.pixelSize_( pixelSize ); }
63   pixelSize_ { arg pixelSize;
64     size = pixelSize;
65     hasPointSize = false;
66   }
68   pointSize_ { arg pointSize;
69     size = pointSize;
70     hasPointSize = true;
71   }
73   pixelSize { ^( if(hasPointSize){nil}{size} ) }
75   pointSize { ^( if(hasPointSize){size}{nil} ) }
77   /* ------------------ private -----------------*/