Diferencia entre revisiones de «Imagen Digital:PDF»
De Casiopea
Línea 20: | Línea 20: | ||
hint(ENABLE_NATIVE_FONTS); | hint(ENABLE_NATIVE_FONTS); | ||
size(612, 792, PDF, "file.pdf"); | size(612, 792, PDF, "file.pdf"); | ||
helv = createFont(" | helv = createFont("Bodoni MT Condensed", 12); | ||
textFont(helv, 6); | textFont(helv, 6); | ||
lista = PFont.list(); | lista = PFont.list(); | ||
Línea 32: | Línea 32: | ||
for (int i = 0; i < lista.length ; i++){ | for (int i = 0; i < lista.length ; i++){ | ||
text(lista[i], x, y); | text(lista[i], x, y); | ||
y += 7; | y += 7; //interlínea | ||
if (y > (height - 20)) { | if (y > (height - 20)) { | ||
y = 20; // | y = 20; // reset y | ||
x += 90;// intercolumna | x += 90;// intercolumna | ||
} | } | ||
Línea 42: | Línea 42: | ||
exit(); | exit(); | ||
} | } | ||
</nowiki> | </nowiki> | ||
</pre> | </pre> |
Revisión actual - 17:43 14 ago 2007
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("Bodoni MT Condensed", 12); 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; //interlínea if (y > (height - 20)) { y = 20; // reset y x += 90;// intercolumna } } println("listo"); exit(); }
Dibujo desde la función noise(x,y)
import processing.pdf.*; void setup(){ size(612, 792, PDF, "dibujo.pdf"); background(255); stroke(0); noFill(); strokeWeight(0.25); } void draw(){ for (float y = 0; y < height; y += 5){ beginShape(); for (float x = 0; x < width; x += 3){ float n = noise(x/100.0, y/100.0)*60; if ((y+n) > height){ break; } curveVertex(x,y+n); } endShape(); } println("listo"); exit(); }