You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,7 +24,7 @@ Visit our reference section on [`text()`](/reference/#text) for additional typog
24
24
25
25
### Change type attributes
26
26
Add these one at a time *before* your text frame, as they only effect proceeding `text()`.
27
-
```
27
+
```js
28
28
textFont("Helvetica", "Regular");
29
29
// copy name exactly as found when selecting fonts by pull-down menu
30
30
// optional 2nd param to specify font-weight
@@ -36,22 +36,22 @@ textTracking(500);
36
36
### Overflowing text
37
37
If the font gets too big, you'll see that the type is now flowing past the bounds of the box, so let's resize it. In order to change the TextFrame we just built, we need to create it as a variable so that we can easily refer to it later. To do this, simply changing the following:
38
38
39
-
```
39
+
```js
40
40
// text("hello world", 0, 0, 350, 50);
41
41
var myFrame =text("hello world", 0, 0, 350, 50);
42
42
```
43
43
44
44
Note the 'var myFrame = ' placed in front of our text() code.<br>
45
45
We can now refer to it and resize it, by writing the following after our manipulations:
46
-
```
46
+
```js
47
47
transform(myFrame, "size", [width, height]);
48
48
```
49
49
50
50
The bounding box is now as big as our page's width + height.
51
51
### Styling those contents
52
52
53
53
Now that you can refer to your text frame, let's change further attributes inside using the all encompassing `typo()` function:
54
-
```
54
+
```js
55
55
typo(myFrame, 'pointSize', 100);
56
56
typo(myFrame, 'strikeThru', true); // add strike through
57
57
typo(myFrame, 'characterRotation', -45); // add strike through
@@ -71,7 +71,7 @@ If creating a generative book across multiple pages, you'll surely want to know
71
71
72
72
Start with a new document and let's build two very generative text frames
@@ -170,7 +170,7 @@ This code is looking for an object or text that is selected and grabs the very f
170
170
171
171
Next let's break the selection down and isolate every single word within the text. Todo this, we have two ways to walk forward. Both accomplish the exact same task, but approach it quite differently.
172
172
173
-
```
173
+
```js
174
174
words(selItems, function(w, n){
175
175
typo(w, "pointSize", n+1);
176
176
});
@@ -180,7 +180,7 @@ The snippet above is the most efficient way to cycle through all of the words, o
180
180
181
181
Think about how long that would take you with the mouse...!
182
182
183
-
```
183
+
```js
184
184
var myWords =words(selItems);
185
185
186
186
for (var i =0; i <myWords.length; i++) {
@@ -208,7 +208,7 @@ and test different combinations of modifying the content based on typo() or othe
208
208
## 4. Example - Website typo
209
209
Here is a quick script demonstrating how to recreate the headlines as seen on this website:
0 commit comments