/usr/share/SuperCollider/HelpSource/Classes/Font.schelp is in supercollider-common 1:3.8.0~repack-2.
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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | class:: Font
summary:: A font object
categories:: GUI>Accessories
description::
This is the object you pass to other gui objects to set their font name or size.
classmethods::
private::key
method:: new
argument:: name
An instance of link::Classes/String::. Must coincide with the name of a font on the system. See link::#*availableFonts::.
argument:: size
An instance of link::Classes/Float::.
argument:: bold
A Boolean.
argument:: italic
A Boolean.
argument:: usePointSize
A Boolean. Whether to regard the strong::size:: argument as point-size - adapting to the screen resolution.
discussion::
Example:
code::
g = Font("Helvetica", 12);
::
method:: availableFonts
returns::
link::Classes/Array:: of the available fonts.
method:: antiAliasing
argument:: flag
An instance of link::Classes/Boolean::. Default value is code::false::.
method:: smoothing
argument:: flag
An instance of link::Classes/Boolean::. Default value is code::false::.
method:: defaultSansFace
returns::
The default sans serif face Font.
method:: defaultSerifFace
returns::
The default serif face Font.
method:: defaultMonoFace
returns::
The default monospace face Font.
method:: default
The global default Font.
Setting this property is equivalent to code::Font.setDefault(font)::. See link::#*setDefault:: for details.
method:: setDefault
Sets the global default font. Properties of the code::font:: argument will be combined with properties of the default system font, and those of individual views.
Optionally, a class can be given, so only views of that class will be affected.
Note that this will immediately affect any existing views.
argument:: font
An instance of Font.
argument:: class
A Class (either View or one of its subclasses), or code::nil::.
method:: sansSerif
Create a new sans serif face Font.
method:: monospace
Create a new monospace face Font.
method:: serif
Create a new serif face Font.
instancemethods::
method:: name
Gets/sets the name of the font.
argument:: value
An instance of link::Classes/String::.
method:: size
Gets/sets the size of the font.
Setting this variable is always considered as setting the link::#-pixelSize::, while getting it will return any size set. See link::#-hasPointSize:: for distinction.
argument:: pixelSize
A Float.
method:: hasPointSize
A Boolean variable indicating whether the link::#-size:: is regarded as pixel-size (precise amount of pixels), or point-size (adapting to screen resolution).
To change this, you need to set the size via link::#-pixelSize:: or link::#-pointSize::.
method:: pixelSize
Gets or sets the pixel-size of the font. When getting, returns nil if the font has point-size instead. See link::#-hasPointSize:: for distinction.
Argument::
Any number, but note that floats will be rounded to integer values when setting pixel-size.
method:: pointSize
Gets or sets the point-size of the font. When getting, returns nil if the font has pixel-size instead. See link::#-hasPointSize:: for distinction.
Argument::
A Float.
method:: setDefault
Makes this instance of Font the default.
This is equivalent to calling link::#*setDefault:: with this Font and the given class as arguments.
method:: storeArgs
(?)
Returns:: an link::Classes/Array::, code:: [ name, size ] ::.
method:: boldVariant
note:: On the Cocoa GUI it appends teletype::"-Bold":: to the name. This is only useful for fonts that have bold
variants.
::
returns::
Bold variant of the Font.
examples::
code::
(
w = Window.new.front;
t = StaticText(w, w.view.bounds).align_(\center);
t.string=" SUPERCOLLIDER";
)
t.font = Font("Monaco", 24);
(
var updateFont;
w = Window("Fonts", Rect(150, Window.screenBounds.height - 500, 400, 400)).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 = ["6","7","8","9","10","12","13","14","18","24","36","48","60","72","96"];
t = TextView(w, Rect(10, 40, 380, 150));
t.string = "\nThe quick drowned fox jumped over the lazy blog. \n\n 0 1 2 3 4 5 6 7 8 9 ";
a = StaticText(w, 200@20).string_("The quick drowned fox").background_(Color.rand).align_(\center);
b = Button(w, 200@20).states_([["The quick drowned fox"]]).background_(Color.rand);
c = PopUpMenu(w, 200@20).items_(["The quick drowned fox"]).background_(Color.rand);
y.action = {
var font;
font = Font(m.items[m.value],y.items[y.value].asInteger);
a.font_(font).refresh;
b.font_(font).refresh;
c.font_(font).refresh;
t.font_(font).refresh;
};
m.action = y.action;
m.valueAction = 3;
y.valueAction = 5;
)
(
var w, f;
w = Window("Fonts", Rect(128, 64, 340, 360));
w.view.decorator = f = FlowLayout(w.view.bounds,Point(4, 4),Point(4, 2));
[
"Helvetica-Bold",
"Helvetica",
"Monaco",
"Arial",
"Gadget",
"MarkerFelt-Thin"
].do({ arg name;
var v, s, n, spec, p, height = 16;
v = StaticText(w, Rect(0, 0, 110, height + 20));
v.font = Font(name, 13);
v.string = name;
s = Button(w, Rect(0, 0, 140, height + 20));
s.font = Font(name, 13);
s.states = [[name]];
n = NumberBox(w, Rect(0, 0, 56, height + 20));
n.font = Font(name, 13);
n.object = pi;
f.nextLine;
});
w.front;
)
(
var w, f, i = 0;
w = Window("Fonts", Rect(128, 64, 1024, 768));
b = ScrollView(w, w.view.bounds);
b.decorator = f = FlowLayout(b.bounds, Point(4,4), Point(4,2));
Font.availableFonts.do({ arg name;
var v, s, n, spec, p, height = 16, font;
font = Font(name,13);
v = StaticText(b, Rect(0, 0, 120, height + 20));
v.font = font;
v.string = name;
s = Button(b, Rect(0, 0, 140, height + 20));
s.font = font;
s.states = [[name]];
s.action = { font.asCompileString.postln; };
n = NumberBox(b, Rect(0, 0, 56, height + 20));
n.font = font;
n.object = pi;
if( (i = i + 1) % 3 == 0,{
f.nextLine;
});
});
w.front;
)
::
|