-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProcessing_TypeCon.pde
85 lines (74 loc) · 2.19 KB
/
Processing_TypeCon.pde
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
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TypeCon Type Deflector
// by Nicholas Felton
// Reflection-based drawing app developed for TypeCon 2015 Identity System
// Requires Control P5 Library: http://www.sojamo.de/libraries/controlP5/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// FEATURES
// Click anywhere to add a new line to drawing.
// Click and hold to change the start position of the last line.
// Subsequent single clicks create new lines.
// Line length and reflection style can be adjusted using the on-screen controls.
// Edit 'typeString' to change text.
// Edit 'typeFace' and 'typeSize' to change the typeface parameters.
// Press 's' key to save drawing as a pdf
// - - - - - - - - - - - - - - - - - - - - - - -
// LIBRARIES
// - - - - - - - - - - - - - - - - - - - - - - -
import java.util.Calendar;
import processing.pdf.*;
import controlP5.*;
// - - - - - - - - - - - - - - - - - - - - - - -
// GLOBAL VARIABLES
// - - - - - - - - - - - - - - - - - - - - - - -
// Type
PFont myFont;
String typeface = "Helvetica-Bold";
String typeString = "CONDENSED";
int typeSize = 260;
color c_textFill = color(50);
// PGraphics
PGraphics pg;
// Deflector
Deflector myDeflector[];
int startMarkerSize = 20;
int drawCycles = 1000;
boolean record;
int deflectionFactor = -2;
int deflectionSetting = 1;
// Control P5
ControlP5 cp5;
Slider s1;
RadioButton r;
// - - - - - - - - - - - - - - - - - - - - - - -
// SETUP
// - - - - - - - - - - - - - - - - - - - - - - -
void setup() {
size(1800, 600);
smooth();
cp5 = new ControlP5(this);
initializeSlider();
initializeSelector();
myFont = createFont(typeface, 50);
myDeflector = new Deflector[0];
drawOffScreenText(); // draw buffer once in setup to add initial point
randomPoint();
}
// - - - - - - - - - - - - - - - - - - - - - - -
// DRAW
// - - - - - - - - - - - - - - - - - - - - - - -
void draw() {
if (record) {
beginRecord(PDF, timestamp() + "_##.pdf");
}
background(0);
drawOffScreenText();
drawScreenText();
for (int i=0; i<myDeflector.length; i++) {
myDeflector[i].display();
}
if (record) {
endRecord();
record = false;
}
}