Hey
sorry guys but I got a problem.
I loaded a font in my processing-project. when i display the project for a test it shows me the right font. But after a while i look at the PDF export file and in there where a standard font.. not mine which i choose.
I hope my english is not two bad. Thanks for helping and have a good day
If u need any Screens or the PDF i try to uplaod it.
Code:
import processing.pdf.*;
Kurve kurv;
float i = 3; // 300 dpi 4.16 multiplikator
float varx = 842.0; // Breite A4 auf 72 dpi in PXL
float vary = 1191.0; // Breite A4 auf 72 dpi in PXL
int xSize;
int ySize;
String[] ldr;
int ndx = 0;
int bland = 0;
int blandziel = 0;
int maxbland = 16;
int zahler = 4;
int abstandvar;
int koor[][] = new int[16][8];
int nwhnrall;
int vrbl = 0;
int vrbl2 = 0;
float varheight;
float varall;
float varhold;
float varhold2;
float varhold3;
float varhold1;
float varhold12;
float varhold13;
PFont GravurLight;
void setup() {
noLoop();
varx = varx * i;
vary = vary * i;
varx += 0.5;
vary += 0.5;
xSize = (int)varx;
ySize = (int)vary;
size(xSize,ySize);
abstandvar = height/maxbland;
smooth();
beginRecord(PDF, "export1.pdf");
GravurLight = createFont("GravurCondensed-Light", 12, true);
background(255);
}
void draw() {
noFill();
ldr = loadStrings("daten.txt");
while (ndx < ldr.length) {
String [] pcs = split(ldr[ndx], "-");
if (pcs.length == 20) {
while (zahler < pcs.length) {
int e = int (pcs[zahler]);
koor[blandziel][6] = koor[blandziel][6] + e;
koor[bland][7] = koor[bland][7] + e;
blandziel++;
zahler++;
}
}
nwhnrall = nwhnrall + koor[bland][7];
bland++;
ndx++;
zahler=4;
blandziel=0;
}
bland = 0;
ndx = 0;
varall = nwhnrall;
varheight = height;
varheight = varheight - 16.0 * 6;
for (int cnt1=0; cnt1 < 16; cnt1++) {
koor[cnt1][0] = vrbl + 8;
varhold = koor[cnt1][0];
varhold3 = koor[cnt1][7];
varhold2 = varhold + varheight / varall * varhold3 -2.0;
koor[cnt1][1] = (int) varhold2;
koor[cnt1][2] = 0;
vrbl = koor[cnt1][1];
koor[cnt1][3] = vrbl2 + 8;
varhold1 = koor[cnt1][3];
varhold13 = koor[cnt1][6];
varhold12 = varhold1 + varheight / varall * varhold13 -2.0;
koor[cnt1][4] = (int) varhold2;
koor[cnt1][5] = 0;
vrbl2 = koor[cnt1][4];
}
while (ndx < ldr.length) {
String [] pcs = split(ldr[ndx], "-");
if (pcs.length == 20) {
int a = int (pcs[0]);
int b = int (pcs[1]);
int c = int (pcs[2]);
String d = pcs[3];
while (zahler < pcs.length) {
int e = int (pcs[zahler]);
kurv = new Kurve(blandziel,bland,color(a,b,c,85),e/500,d);
kurv.display();
blandziel++;
zahler++;
}
}
bland++;
ndx++;
zahler=4;
blandziel=0;
}
println("LÄUFT GUT");
endRecord();
}
class Kurve {
int z;
float vz;
int start;
int ziel;
int varstart;
int varziel;
color farbe;
float vpunkt11;
float vpunkt12;
float vpunkt21;
float vpunkt22;
int punkt11;
int punkt12;
int punkt21;
int punkt22;
String name;
float logschwank (int x) {
return (log(x) / log(height));
}
float schwank;
Kurve (int _start, int _ziel, color _farbe, int _z, String _name) {
start = _start;
ziel = _ziel;
farbe = _farbe;
z = _z;
name = _name;
schwank = logschwank(abstandvar) * width;
}
void display() {
if (start == ziel) {
fill(0);
textFont(GravurLight);
text(name, 5, koor[start][0]+3, 17*i, (koor[start][0]+(koor[start][1]-koor[start][0])));
text(name, width-17*i, koor[start][3]+3, width-5, (koor[start][3]+(koor[start][4]-koor[start][3])));
noFill();
stroke(0,0,0,128);
line(5,koor[start][0]-2,20*i,koor[start][0]-2);
line(5,koor[start][1]+2,20*i,koor[start][1]+2);
line(width-5,koor[start][3]-2,width-20*i,koor[start][3]-2);
line(width-5,koor[start][4]+2,width-20*i,koor[start][4]+2);
}
while (z > 0) {
stroke(farbe);
varstart = koor[start][0] + koor[start][2];
varziel = koor[ziel][3] + koor[ziel][5];
koor[start][2] = koor[start][2] + 2;
koor[ziel][5] = koor[ziel][5] + 2;
if (koor[start][0] + koor[start][2] > koor[start][1]) {
koor[start][2] = 0;
}
if (koor[ziel][3] + koor[ziel][5] > koor[ziel][4]) {
koor[ziel][5] = 0;
}
vpunkt11 = random(120*i,schwank);
punkt11 = (int)vpunkt11;
vpunkt12 = random(varstart-abstandvar/16,varstart+abstandvar/16);
punkt12 = (int)vpunkt12;
vpunkt21 = random(schwank);
punkt21 = (int)vpunkt21;
vpunkt22 = random(varziel-abstandvar/16,varziel+abstandvar/16);
punkt22 = (int)vpunkt22;
bezier(20*i, varstart, punkt11, punkt12, punkt21, punkt22, width-20*i, varziel);
z--;
}
}
}