/usr/share/SuperCollider/SCClassLibrary/QtCollider/QFont.sc is in supercollider-common 1:3.6.3~repack-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | QFont {
classvar <defaultSansFace, <defaultSerifFace, <defaultMonoFace;
var <>name, <size, <>bold, <>italic, <hasPointSize=false;
/* ----------------- class -------------------*/
*implementsClass {^'Font'}
*initClass {
defaultSansFace = this.prDefaultFamilyForStyle(0);
defaultSerifFace = this.prDefaultFamilyForStyle(1);
defaultMonoFace = this.prDefaultFamilyForStyle(2);
}
*new { arg name, size, bold = false, italic = false, usePointSize = false;
^super.newCopyArgs( name, size, bold, italic, usePointSize );
}
*availableFonts {
_Qt_AvailableFonts
}
*antiAliasing_ { arg flag;
}
*smoothing_ { arg flag;
}
*default {
^QFont();
}
*default_ { arg font;
this.setDefault(font);
}
*setDefault { arg font, class;
this.prSetDefault(font, class !? {class.qtClass});
}
*monospace {|size, bold = false, italic = false, usePointSize = false|
^this.new(this.defaultMonoFace, size, bold, italic, usePointSize)
}
*serif {|size, bold = false, italic = false, usePointSize = false|
^this.new(this.defaultSerifFace, size, bold, italic, usePointSize)
}
*sansSerif {|size, bold = false, italic = false, usePointSize = false|
^this.new(this.defaultSansFace, size, bold, italic, usePointSize)
}
/* ------------------instance------------------*/
setDefault { arg class;
QFont.setDefault(this, class);
}
boldVariant {
^this.class.new( name, size, true, italic );
}
size_ { arg pixelSize; this.pixelSize_( pixelSize ); }
pixelSize_ { arg pixelSize;
size = pixelSize;
hasPointSize = false;
}
pointSize_ { arg pointSize;
size = pointSize;
hasPointSize = true;
}
pixelSize { ^( if(hasPointSize){nil}{size} ) }
pointSize { ^( if(hasPointSize){size}{nil} ) }
// support Qt GUI in combination with CocoaDocument
asSCFont {
var cocoa, scfont;
cocoa = GUI.get(\cocoa);
if(cocoa.notNil) {
scfont = cocoa.font.new(name, size);
if(bold){scfont = scfont.boldVariant};
^scfont;
}{
^nil
}
}
/* ------------------ private -----------------*/
*prSetDefault { arg font, className;
_QFont_SetDefaultFont
^this.primitiveFailed;
}
*prDefaultFamilyForStyle { arg style = -1;
_QFont_DefaultFamilyForStyle
^this.primitiveFailed;
}
}
|