Imagen Digital:PDF
De Casiopea
Lista de Fuentes en una página tamaño carta
// Crear PDF import processing.pdf.*; // importa la biblioteca que maneja PDF /* Cuando construímos un PDF, la unidades pixeles se convierten a puntos. 1 punto = 0.37 milímetros */ PFont helv; String[] lista; void setup(){ hint(ENABLE_NATIVE_FONTS); size(612, 792, PDF, "file.pdf"); helv = createFont("Arial Narrow", 12); //da lo mismo el tamaño porque es vectorial, pero hay que ingresar un valor de todos modos textFont(helv, 6); lista = PFont.list(); background(255); fill(0); } void draw(){ int x = 10; int y = 20; for (int i = 0; i < lista.length ; i++){ text(lista[i], x, y); y += 7; if (y > (height - 20)) { y = 20; // interlínea x += 90;// intercolumna } } println("listo"); exit(); }
Dibujo desde la función noise(x,y)
import processing.pdf.*; //límites del dibujo int x1, x2, y1, y2; void setup(){ size(612, 792, PDF, "dibujo.pdf"); background(255); stroke(0); noFill(); strokeWeight(0.25); x1 = 50; x2 = width - 50; y1 = 50; y2 = height - 50; } void draw(){ for (float y = 0; y < height; y+=10){ beginShape(); for (float x = 0; x < width; x+=1){ float n = noise((float)x/100.0, y/100.0)*100; curveVertex(x,y+n); } endShape(); } println("listo"); exit(); }