Skip to content

Commit 8a7c957

Browse files
committed
Updated descriptions in comments for processing core and libraries
1 parent ca77f52 commit 8a7c957

File tree

26 files changed

+5196
-4210
lines changed

26 files changed

+5196
-4210
lines changed

core/src/processing/core/PApplet.java

Lines changed: 2804 additions & 2345 deletions
Large diffs are not rendered by default.

core/src/processing/core/PConstants.java

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -127,41 +127,42 @@ public interface PConstants {
127127

128128
// useful goodness
129129

130-
/**
131-
*
132-
* PI is a mathematical constant with the value 3.14159265358979323846. It
133-
* is the ratio of the circumference of a circle to its diameter. It is
134-
* useful in combination with the trigonometric functions <b>sin()</b> and
135-
* <b>cos()</b>.
136-
*
137-
* @webref constants
138-
* @webBrief PI is a mathematical constant with the value 3.14159265358979323846.
139-
* @see PConstants#TWO_PI
140-
* @see PConstants#TAU
141-
* @see PConstants#HALF_PI
142-
* @see PConstants#QUARTER_PI
143-
*
144-
*/
130+
/**
131+
*
132+
* <b>PI</b> is a mathematical constant with the value 3.1415927. It is the
133+
* ratio of the circumference of a circle to its diameter. It is useful in
134+
* combination with the trigonometric functions <b>sin()</b> and <b>cos()</b>.
135+
*
136+
* @webref constants
137+
* @webBrief PI is a mathematical constant with the value
138+
* 3.14159265358979323846.
139+
* @see PConstants#TWO_PI
140+
* @see PConstants#TAU
141+
* @see PConstants#HALF_PI
142+
* @see PConstants#QUARTER_PI
143+
*
144+
*/
145145
static final float PI = (float) Math.PI;
146-
/**
147-
*
148-
* HALF_PI is a mathematical constant with the value
149-
* 1.57079632679489661923. It is half the ratio of the circumference of a
150-
* circle to its diameter. It is useful in combination with the
151-
* trigonometric functions <b>sin()</b> and <b>cos()</b>.
152-
*
153-
* @webref constants
154-
* @webBrief HALF_PI is a mathematical constant with the value 1.57079632679489661923.
155-
* @see PConstants#PI
156-
* @see PConstants#TWO_PI
157-
* @see PConstants#TAU
158-
* @see PConstants#QUARTER_PI
159-
*/
146+
/**
147+
*
148+
* <b>HALF_PI</b> is a mathematical constant with the value 1.5707964. It is
149+
* half the ratio of the circumference of a circle to its diameter. It is useful
150+
* in combination with the trigonometric functions <b>sin()</b> and
151+
* <b>cos()</b>.
152+
*
153+
* @webref constants
154+
* @webBrief HALF_PI is a mathematical constant with the value
155+
* 1.57079632679489661923.
156+
* @see PConstants#PI
157+
* @see PConstants#TWO_PI
158+
* @see PConstants#TAU
159+
* @see PConstants#QUARTER_PI
160+
*/
160161
static final float HALF_PI = (float) (Math.PI / 2.0);
161162
static final float THIRD_PI = (float) (Math.PI / 3.0);
162163
/**
163164
*
164-
* QUARTER_PI is a mathematical constant with the value 0.7853982. It is
165+
* <b>QUARTER_PI</b> is a mathematical constant with the value 0.7853982. It is
165166
* one quarter the ratio of the circumference of a circle to its diameter.
166167
* It is useful in combination with the trigonometric functions
167168
* <b>sin()</b> and <b>cos()</b>.
@@ -176,7 +177,7 @@ public interface PConstants {
176177
static final float QUARTER_PI = (float) (Math.PI / 4.0);
177178
/**
178179
*
179-
* TWO_PI is a mathematical constant with the value 6.28318530717958647693.
180+
* <b>TWO_PI</b> is a mathematical constant with the value 6.2831855.
180181
* It is twice the ratio of the circumference of a circle to its diameter.
181182
* It is useful in combination with the trigonometric functions
182183
* <b>sin()</b> and <b>cos()</b>.
@@ -189,20 +190,21 @@ public interface PConstants {
189190
* @see PConstants#QUARTER_PI
190191
*/
191192
static final float TWO_PI = (float) (2.0 * Math.PI);
192-
/**
193-
*
194-
* TAU is an alias for TWO_PI, a mathematical constant with the value
195-
* 6.28318530717958647693. It is twice the ratio of the circumference
196-
* of a circle to its diameter. It is useful in combination with the
197-
* trigonometric functions <b>sin()</b> and <b>cos()</b>.
198-
*
199-
* @webref constants
200-
* @webBrief An alias for TWO_PI
201-
* @see PConstants#PI
202-
* @see PConstants#TWO_PI
203-
* @see PConstants#HALF_PI
204-
* @see PConstants#QUARTER_PI
205-
*/
193+
/**
194+
*
195+
* <b>TAU</b> is a mathematical constant with the value 6.2831855. It is the
196+
* circle constant relating the circumference of a circle to its linear
197+
* dimension, the ratio of the circumference of a circle to its radius. It is
198+
* useful in combination with trigonometric functions such as <b>sin()</b> and
199+
* <b>cos()</b>.
200+
*
201+
* @webref constants
202+
* @webBrief An alias for TWO_PI
203+
* @see PConstants#PI
204+
* @see PConstants#TWO_PI
205+
* @see PConstants#HALF_PI
206+
* @see PConstants#QUARTER_PI
207+
*/
206208
static final float TAU = (float) (2.0 * Math.PI);
207209

208210
static final float DEG_TO_RAD = PI/180.0f;

core/src/processing/core/PFont.java

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,23 @@
3535

3636

3737
/**
38-
* Grayscale bitmap font class used by Processing.
38+
* PFont is the font class for Processing. To create a font to use with
39+
* Processing, select "Create Font..." from the Tools menu. This will create a
40+
* font in the format Processing requires and also adds it to the current
41+
* sketch's data directory. Processing displays fonts using the .vlw font
42+
* format, which uses images for each letter, rather than defining them through
43+
* vector data. The <b>loadFont()</b> function constructs a new font and
44+
* <b>textFont()</b> makes a font active. The <b>list()</b> method creates a
45+
* list of the fonts installed on the computer, which is useful information to
46+
* use with the <b>createFont()</b> function for dynamically converting fonts
47+
* into a format to use with Processing.<br />
48+
* <br />
49+
* To create a new font dynamically, use the <b>createFont()</b> function. Do
50+
* not use the syntax <b>new PFont()</b>.
51+
*
3952
* <P>
4053
* Awful (and by that, I mean awesome) ASCII (non-)art for how this works:
54+
*
4155
* <PRE>
4256
* |
4357
* | height is the full used height of the image
@@ -55,6 +69,7 @@
5569
*
5670
* ^^^^^^^^^^^^^^ setWidth (width displaced by char)
5771
* </PRE>
72+
*
5873
* @webref typography
5974
* @webBrief Grayscale bitmap font class used by Processing.
6075
* @see PApplet#loadFont(String)
@@ -869,20 +884,18 @@ public PShape getShape(char ch, float detail) {
869884
}
870885

871886

872-
/**
873-
*
874-
* Gets a list of the fonts installed on the system. The data is returned
875-
* as a String array. This list provides the names of each font for input
876-
* into <b>createFont()</b>, which allows Processing to dynamically format
877-
* fonts. This function is meant as a tool for programming local
878-
* applications and is not recommended for use in applets.
879-
*
880-
*
881-
* @webref pfont
882-
* @webBrief Gets a list of the fonts installed on the system.
883-
* @usage application
884-
* @brief Gets a list of the fonts installed on the system
885-
*/
887+
/**
888+
*
889+
* Gets a list of the fonts installed on the system. The data is returned as a
890+
* String array. This list provides the names of each font for input into
891+
* <b>createFont()</b>, which allows Processing to dynamically format fonts.
892+
*
893+
*
894+
* @webref pfont
895+
* @webBrief Gets a list of the fonts installed on the system.
896+
* @usage application
897+
* @brief Gets a list of the fonts installed on the system
898+
*/
886899
static public String[] list() {
887900
loadFonts();
888901
String[] list = new String[fonts.length];

0 commit comments

Comments
 (0)