2 classvar defaultSansFace, defaultSerifFace, defaultMonoFace;
3 var <>name, <size, <>bold, <>italic, <hasPointSize=false;
4 /* ----------------- class -------------------*/
10 *new { arg name, size, bold = false, italic = false, usePointSize = false;
11 ^super.newCopyArgs( name, size, bold, italic, usePointSize );
18 *antiAliasing_ { arg flag;
21 *smoothing_ { arg flag;
40 *monospace {|size, bold = false, italic = false, usePointSize = false|
41 ^this.new(this.defaultMonoFace, size, bold, italic, usePointSize)
44 *serif {|size, bold = false, italic = false, usePointSize = false|
45 ^this.new(this.defaultSerifFace, size, bold, italic, usePointSize)
48 *sansSerif {|size, bold = false, italic = false, usePointSize = false|
49 ^this.new(this.defaultSansFace, size, bold, italic, usePointSize)
52 /* ------------------instance------------------*/
58 ^this.class.new( name, size, true, italic );
61 size_ { arg pixelSize; this.pixelSize_( pixelSize ); }
63 pixelSize_ { arg pixelSize;
68 pointSize_ { arg pointSize;
73 pixelSize { ^( if(hasPointSize){nil}{size} ) }
75 pointSize { ^( if(hasPointSize){size}{nil} ) }
77 // support Qt GUI in combination with CocoaDocument
80 cocoa = GUI.get(\cocoa);
82 scfont = cocoa.font.new(name, size);
83 if(bold){scfont = scfont.boldVariant};
90 /* ------------------ private -----------------*/