I have finished one project and would like to add my custom font from PCB DOS because it looks more professional and it is more nice that EAGLE have build in.
So i need example script that takes in Board Editor names and values of components and replace it with my defined font or wires in my ulp script that i draw manually or to use external .ttf file that generates then font.
For example, i have two resistors in Board Editor, when i run font_change.ulp script i need to get R1 and R2 (name of components), and then search in ulp script that names and put from script that names to resistor position like it original was but with different font.
Can you please give me example ulp script that do that? I will then update font style with wires in that script manually after that is done correctly.
I try to get all name values of components and this is working:
board(B) {
B.elements(E) dlgMessageBox(E.name, "Ok");
}
So i got two message box with values R1 and R2. Now i could not know how to add case with custom defined font in that ulp file and replace R1 and R2 on resistor name with my custom font?
So i need like this:
switch(E.name):
case "R1":
LINE 10, 20, 16, 23, 0.254
LINE 12, 24, 12, 21, 0.254
break;
case "R2":
LINE 11, 26, 17, 22, 0.254
LINE 13, 25, 13, 29, 0.254
break;
}
Then replace R1 on resistor name with above lines.
Solved! Go to Solution.
I have finished one project and would like to add my custom font from PCB DOS because it looks more professional and it is more nice that EAGLE have build in.
So i need example script that takes in Board Editor names and values of components and replace it with my defined font or wires in my ulp script that i draw manually or to use external .ttf file that generates then font.
For example, i have two resistors in Board Editor, when i run font_change.ulp script i need to get R1 and R2 (name of components), and then search in ulp script that names and put from script that names to resistor position like it original was but with different font.
Can you please give me example ulp script that do that? I will then update font style with wires in that script manually after that is done correctly.
I try to get all name values of components and this is working:
board(B) {
B.elements(E) dlgMessageBox(E.name, "Ok");
}
So i got two message box with values R1 and R2. Now i could not know how to add case with custom defined font in that ulp file and replace R1 and R2 on resistor name with my custom font?
So i need like this:
switch(E.name):
case "R1":
LINE 10, 20, 16, 23, 0.254
LINE 12, 24, 12, 21, 0.254
break;
case "R2":
LINE 11, 26, 17, 22, 0.254
LINE 13, 25, 13, 29, 0.254
break;
}
Then replace R1 on resistor name with above lines.
Solved! Go to Solution.
Solved by C.Nicks. Go to Solution.
I don't think custom fonts are even possible in eagle. I think your only options are Proportional, fixed, Vector new and Vector Old.
Have you tried the old and new vector fonts? I quite like the new ones and they look great on a board.
I don't think custom fonts are even possible in eagle. I think your only options are Proportional, fixed, Vector new and Vector Old.
Have you tried the old and new vector fonts? I quite like the new ones and they look great on a board.
I made a little progress, i write this little script that run in Board Editor (ULP) and create R with lines (i convert from DOS program to lines and create nice R looking font that i will use on layer 55 tfName).
string cmd = "";
board(B) {
B.elements(E) if (E.name == "R1") { cmd = "LINE 25 0.254 (-0.950 0.635) (-0.950 -0.635); LINE 25 0.254 (-0.950 0.635) (-0.320 0.635); LINE 25 0.254 (-0.320 0.635) (-0.090 0.425); LINE 25 0.254 (-0.090 0.425) (-0.090 0.226); LINE 25 0.254 (-0.090 0.226) (-0.320 -0.005); LINE 25 0.254 (-0.320 -0.005) (-0.950 -0.005); LINE 25 0.254 (-0.720 -0.005) (-0.090 -0.635);"; exit(cmd); dlgMessageBox("R1", "Ok"); };
}
But i don't know how to get variable into position x and y, so i know how to get R1 resistor position by calling E.x and E.y but i can't + or - with above code so that i can center it inside resistor like tName have.
So i want to have this:
B.elements(E) if (E.name == "R1") { cmd = "LINE 25 0.254 ((E.x + -0.950) (E.y + 0.635)) ((E.x + -0.950) (E.y + -0.635));"; exit(cmd); dlgMessageBox("R1", "Ok"); };
So how to + and - variable ofset E.x and E.y with values that i define above so that i can center my custom font R inside center R?
I made a little progress, i write this little script that run in Board Editor (ULP) and create R with lines (i convert from DOS program to lines and create nice R looking font that i will use on layer 55 tfName).
string cmd = "";
board(B) {
B.elements(E) if (E.name == "R1") { cmd = "LINE 25 0.254 (-0.950 0.635) (-0.950 -0.635); LINE 25 0.254 (-0.950 0.635) (-0.320 0.635); LINE 25 0.254 (-0.320 0.635) (-0.090 0.425); LINE 25 0.254 (-0.090 0.425) (-0.090 0.226); LINE 25 0.254 (-0.090 0.226) (-0.320 -0.005); LINE 25 0.254 (-0.320 -0.005) (-0.950 -0.005); LINE 25 0.254 (-0.720 -0.005) (-0.090 -0.635);"; exit(cmd); dlgMessageBox("R1", "Ok"); };
}
But i don't know how to get variable into position x and y, so i know how to get R1 resistor position by calling E.x and E.y but i can't + or - with above code so that i can center it inside resistor like tName have.
So i want to have this:
B.elements(E) if (E.name == "R1") { cmd = "LINE 25 0.254 ((E.x + -0.950) (E.y + 0.635)) ((E.x + -0.950) (E.y + -0.635));"; exit(cmd); dlgMessageBox("R1", "Ok"); };
So how to + and - variable ofset E.x and E.y with values that i define above so that i can center my custom font R inside center R?
Best Regards,
Cameron
Kudos are much appreciated if the information I have shared is helpful to you and/or others.
Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Best Regards,
Cameron
Kudos are much appreciated if the information I have shared is helpful to you and/or others.
Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Can't find what you're looking for? Ask the community or share your knowledge.