Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
A handful of years have gone by since I asked the question on whether it was possible to either generate your own 2D text style font or import this from an outside source.
By any chance has this become easier to do?
My goal is to have a set of text characters that are matched to the text font used with our hand stamps. The 3D characters do not machine correctly.
I did a lengthy Google search but couldn't find any solution.
Solved! Go to Solution.
@pimm wrote:
Martin: Thank you, things are getting clearer through your explanations.
There are a couple points I'd like to discuss.
Please explain why Leroy characters are larger than you expect. I do not understand your problem.
The scale with Leroy is larger than the specified size. I'll show an example between "font" and "leroy":
Notice how "font" stays true to the text height. Conversely "leroy" is larger scaled. What I'd like to find out is whether it is possible to alter a setting to proportionally bring the text to the correct height. I see that the height in the src header is 63 which is the max. The width is specified at 36, but also there is an ICS of 1 and fixed width of 1 which likely means the individual widths take over. Would it be possible to make a universal height change to all text characters?
Another thing that I don't grasp.
The main problem when editing a src file is that PTC does not provide an application that would allow you to draw the shape of the character and then convert it to M and D commands. You have to print a raster on paper and draw the shape of the character in it.
Are you talking about printing off characters and reviewing against needed shapes or printing off a grid to help develop the M and D strokes?
Hi,
Q: Are you talking about printing off characters and reviewing against needed shapes or printing off a grid to help develop the M and D strokes?
A: I mean printing off a grid to help develop the M and D strokes.
Problem: The scale with Leroy is larger than the specified size.
The result of the examination: It is caused by bug in leroy.src.
#73
"I"
width 16
m 8,47
d 8,11
Definition of the above character ends at 47.
base_offset + spec_height must be 47 ... therefore I set spec_height to 36
base_offset + spec_height + ascender must be 63 ... therefore I set ascender to 16
I compiled modified font and created new Sketch feature in new part and result is OK.]
I looked at the Install and Administrator PDF for version 7 (which we are using), it is evident that the structure for generating your own text fonts has not changed. This leads me down a little different road.
Based on how hard it would be to make an entire set of text by hand I would instead prefer to copy the Leroy text font for a different text font file. I would like to
1) Change a couple text characters such as the "1" which shows up as "I".
2) Change the scale as I need to multiply the size I want by .8 to get accurate height.
3) Change the spacing.
4) Save this file and use it as my default
I am a little confused as to how the change order would work. Would I:
1) Copy the .src and .fnt file and rename them, or would there be more files that would need to be copied?
2) Decompile the existing new file using the terminal script
3) Change the .src file
a) modify text such as the "1" using M and D moves.
b) modify the text height universally from somewhere?
c) modify the text spacing universally from somewhere?
4) Compile the new file using a terminal script.
Am I anywhere close with this? Could someone help fill in what I don't have or have incorrect?
In my Google search I did find a thread related to Creo version 5. In this thread there was I believe a compile terminal text. In the example given it gave:
set COMPILE_FONT_PMT=36
compile_font.exe isofont.src isofont.fnt
I tried this for my own generated text font name which I called "stamprite". Before doing the script I copied the Leroy .fnt, .src and .ndx files and renamed them to stamprite.
I entered the "set COMPILE_FONT_PMT=36" line 1st and it entered without feedback.
Next I entered "compile_font.exe stamprite.src stamprite.fnt and got back the following message
I imagine this isn't good but don't know what it means in terms of communicating a change through.
I haven't really made any changes (as my intention will be) as of yet.
Creo did at least read in the stamprite font type.
I don't know how to make the intended changes to the src and have it carry through.
@pimm wrote:
In my Google search I did find a thread related to Creo version 5. In this thread there was I believe a compile terminal text. In the example given it gave:
set COMPILE_FONT_PMT=36
compile_font.exe isofont.src isofont.fnt
I tried this for my own generated text font name which I called "stamprite". Before doing the script I copied the Leroy .fnt, .src and .ndx files and renamed them to stamprite.
I entered the "set COMPILE_FONT_PMT=36" line 1st and it entered without feedback.
Next I entered "compile_font.exe stamprite.src stamprite.fnt and got back the following message
I imagine this isn't good but don't know what it means in terms of communicating a change through.
I haven't really made any changes (as my intention will be) as of yet.
Creo did at least read in the stamprite font type.
I don't know how to make the intended changes to the src and have it carry through.
Hi,
suppose that stamprite.src is located in C:\Users\Public\Documents directory.
You have to:
Martin, thank you for looking at my problem.
The location of both the src and the fnt is in the Creo installed directory. If this is wrong let me know.
In my case the src file is:
Consequently I am assuming that I would enter cd /D C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii
Once there I would enter the set COMPILE_FONT_PMT=36
I would then continue in the command prompt to my fnt file which would be C:\Program Files\PTC\Creo 7.0.4.0\Common Files\Text\usascii
And then would I enter the compile_font.exe stamprite.src stamprite.fnt or would this be one long line?
Could you verify the above, I'm not fluent in using Command Prompt.
Then anytime I needed to make changes I would follow the same script I am assuming.
@pimm wrote:
Martin, thank you for looking at my problem.
The location of both the src and the fnt is in the Creo installed directory. If this is wrong let me know.
In my case the src file is:
Consequently I am assuming that I would enter cd /D C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii
Once there I would enter the set COMPILE_FONT_PMT=36
I would then continue in the command prompt to my fnt file which would be C:\Program Files\PTC\Creo 7.0.4.0\Common Files\Text\usascii
And then would I enter the compile_font.exe stamprite.src stamprite.fnt or would this be one long line?
Could you verify the above, I'm not fluent in using Command Prompt.
Then anytime I needed to make changes I would follow the same script I am assuming.
Hi,
OK, you can use two following commands
cd /D C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii
set COMPILE_FONT_PMT=36
but third command must be
C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe stamprite.src stamprite.fnt
and finally you have to move stamprite.fnt from C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii to C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\text\usascii directory.
Martin: Thank you for catching my error. ☹️
When all of this is entered does this just save what was done in the src file into the fnt file?
If so I will have come to the point of actually getting to my problem with the sizes itself. I will be looking at 2 main issues.
1) minor changes to character shape; which would be where I could just play around with the M and D sizes and orientation until I get what I am looking for, and
2) changing the font scale: For some reason the Leroy characters are larger than the actual size. I am wondering whether it would be possible to apply a universal change to the src file header? The height is specified as 63, the problem with changing this is that the proportion would also change likely.
Hi,
Q: When all of this is entered does this just save what was done in the src file into the fnt file?
A: Yes, compile_font.exe reads src file (text) and creates fnt file (binary).
src file format
start at page 104
height & width ... see page 109
definition raster ... see page 111
---
height & width values define size of the raster which is used to define character shapes.
The actual height of the character is defined only in the drawing.
---
Please explain why Leroy characters are larger than you expect. I do not understand your problem.
The main problem when editing a src file is that PTC does not provide an application that would allow you to draw the shape of the character and then convert it to M and D commands. You have to print a raster on paper and draw the shape of the character in it.
Martin: Thank you, things are getting clearer through your explanations.
There are a couple points I'd like to discuss.
Please explain why Leroy characters are larger than you expect. I do not understand your problem.
The scale with Leroy is larger than the specified size. I'll show an example between "font" and "leroy":
Notice how "font" stays true to the text height. Conversely "leroy" is larger scaled. What I'd like to find out is whether it is possible to alter a setting to proportionally bring the text to the correct height. I see that the height in the src header is 63 which is the max. The width is specified at 36, but also there is an ICS of 1 and fixed width of 1 which likely means the individual widths take over. Would it be possible to make a universal height change to all text characters?
Another thing that I don't grasp.
The main problem when editing a src file is that PTC does not provide an application that would allow you to draw the shape of the character and then convert it to M and D commands. You have to print a raster on paper and draw the shape of the character in it.
Are you talking about printing off characters and reviewing against needed shapes or printing off a grid to help develop the M and D strokes?
@pimm wrote:
Martin: Thank you, things are getting clearer through your explanations.
There are a couple points I'd like to discuss.
Please explain why Leroy characters are larger than you expect. I do not understand your problem.
The scale with Leroy is larger than the specified size. I'll show an example between "font" and "leroy":
Notice how "font" stays true to the text height. Conversely "leroy" is larger scaled. What I'd like to find out is whether it is possible to alter a setting to proportionally bring the text to the correct height. I see that the height in the src header is 63 which is the max. The width is specified at 36, but also there is an ICS of 1 and fixed width of 1 which likely means the individual widths take over. Would it be possible to make a universal height change to all text characters?
Another thing that I don't grasp.
The main problem when editing a src file is that PTC does not provide an application that would allow you to draw the shape of the character and then convert it to M and D commands. You have to print a raster on paper and draw the shape of the character in it.
Are you talking about printing off characters and reviewing against needed shapes or printing off a grid to help develop the M and D strokes?
Hi,
Q: Are you talking about printing off characters and reviewing against needed shapes or printing off a grid to help develop the M and D strokes?
A: I mean printing off a grid to help develop the M and D strokes.
Problem: The scale with Leroy is larger than the specified size.
The result of the examination: It is caused by bug in leroy.src.
#73
"I"
width 16
m 8,47
d 8,11
Definition of the above character ends at 47.
base_offset + spec_height must be 47 ... therefore I set spec_height to 36
base_offset + spec_height + ascender must be 63 ... therefore I set ascender to 16
I compiled modified font and created new Sketch feature in new part and result is OK.]
Martin: It looks as if you have given me everything that I need to solve this issue. That is awesome that you could uncover the errors in the src file! I will run through the entirety of your solution and feedback if I get stuck.
A minor question before trying this out; would the grid size be the same as the character height 63 and the character width of 36? In actuality the only potentially dangerous character would be the "1". This would only require the top slant and lower horizontal line for the M and D moves.
@pimm wrote:
Martin: It looks as if you have given me everything that I need to solve this issue. That is awesome that you could uncover the errors in the src file! I will run through the entirety of your solution and feedback if I get stuck.
A minor question before trying this out; would the grid size be the same as the character height 63 and the character width of 36? In actuality the only potentially dangerous character would be the "1". This would only require the top slant and lower horizontal line for the M and D moves.
Hi,
#49
"1"
width 4
m 2,48
d 2,11
Definition of digit one has width 4, therefore you cannot add another slant line easily.
Maybe you can use definition of digit four which has width 28
#52
"4"
width 28
m 23,11
d 23,47
d 20,47
d 0,27
d 0,24
d 28,24
and use it to create new definition of digit one
#49
"1"
width 28
m 23,11
d 23,47
d 0,27
Thank you Martin.
I would likely have been stuck with the width of 4 digits.
I will try your thought on the modification and see how this works.
Martin: I finally had the chance to put this all together today. Unfortunately something isn't working correctly on the compile. I will attach the message that I am seeing in the Command Prompt. The 1st command script worked. The set script line didn't show any error but nothing changed to my eyes. The third set of script it does not like. I am getting a message that the word Program is not recognized.
Any idea where I am failing?
@pimm wrote:
Martin: I finally had the chance to put this all together today. Unfortunately something isn't working correctly on the compile. I will attach the message that I am seeing in the Command Prompt. The 1st command script worked. The set script line didn't show any error but nothing changed to my eyes. The third set of script it does not like. I am getting a message that the word Program is not recognized.
Any idea where I am failing?
Hi,
path C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe contains space characters. Because of this it must be enclosed in quotation marks as shown below
"C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe" leroy.src leroy.fnt
Martin: I am sorry for all of the trouble but something didn't register correctly. I will include all of the text that I entered in command prompt.
Open Command Prompt
enter cd /D C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii
Once there enter set COMPILE_FONT_PMT=36
Thirdly enter “C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe” stamprite.src stamprite.fnt
There is a chance that I didn't get one of the spacings correct. It could be something completely different.
One point of curiosity is that the recommended script includes the obj folder even though none of the .src, .fnt or .ndex files reside there. Could it be possible that I need to move something into the obj directory?
Another thing to note is that nothing seemed to happen when entering the set COMPILE_FONT_PMT=36 line, but there was no error. When I entered
“C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe” stamprite.src stamprite.fnt there was a brief command prompt blink but nothing else appeared to happen.
Also to note, I changed the Leroy .src file with the recommended sizes and similar to when I entered for stamprite the entered text size did not scale properly.
@pimm wrote:
Martin: I am sorry for all of the trouble but something didn't register correctly. I will include all of the text that I entered in command prompt.
Open Command Prompt
enter cd /D C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii
Once there enter set COMPILE_FONT_PMT=36
Thirdly enter “C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe” stamprite.src stamprite.fnt
There is a chance that I didn't get one of the spacings correct. It could be something completely different.
One point of curiosity is that the recommended script includes the obj folder even though none of the .src, .fnt or .ndex files reside there. Could it be possible that I need to move something into the obj directory?
Another thing to note is that nothing seemed to happen when entering the set COMPILE_FONT_PMT=36 line, but there was no error. When I entered
“C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\obj\compile_font.exe” stamprite.src stamprite.fnt there was a brief command prompt blink but nothing else appeared to happen.
Also to note, I changed the Leroy .src file with the recommended sizes and similar to when I entered for stamprite the entered text size did not scale properly.
Hi,
step no.1
after finishing compile_font.exe” stamprite.src stamprite.fnt command you will find stamprite.fnt file in C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii directory ... please verify it.
step no.2
You have to move stamprite.fnt file to C:\Program Files\PTC\Creo 7.0.4.0\Common Files\x86e_win64\text\usascii directory.
step no.3
You have to create stamprite.ndx file in C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii directory.
Copy leroy.ndx to stamprite.ndx, open stamprite.ndx in Notepad and replace leroy.fnt with stamprite.fnt.
step no.4
Start Creo and create new Sketch feature containing text. You will be able to set stamprite font for it.
Martin: I reviewed the steps you suggested in your last post.
What I am seeing is that I fail on step 1. I don't see the stamprite.fnt file being generated in the C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii directory.
Other differences that I am noticing. I previously copied and renamed a file that I built for the stamprite.fnt to match other files that already were in the x86e_win64\text\usascii directory. (There already was a leroy.fnt file, I copied and renamed that). Thinking that this might be the problem I renamed the stamprite.fnt file that I made and tried the Command Prompts again, but this didn't change anything.
Also; I previously copied and pasted the leroy.ndex file and made a stamprite.ndex file. I also internally changed the text to follow stamprite.
Once again I am sorry that this hasn't worked the way it should.
@pimm wrote:
Martin: I reviewed the steps you suggested in your last post.
What I am seeing is that I fail on step 1. I don't see the stamprite.fnt file being generated in the C:\Program Files\PTC\Creo 7.0.4.0\Common Files\text\usascii directory.
Other differences that I am noticing. I previously copied and renamed a file that I built for the stamprite.fnt to match other files that already were in the x86e_win64\text\usascii directory. (There already was a leroy.fnt file, I copied and renamed that). Thinking that this might be the problem I renamed the stamprite.fnt file that I made and tried the Command Prompts again, but this didn't change anything.
Also; I previously copied and pasted the leroy.ndex file and made a stamprite.ndex file. I also internally changed the text to follow stamprite.
Once again I am sorry that this hasn't worked the way it should.
Hi,
please replay uploaded stamprite.mp4 video. It shows how I created stamprite font from leroy font.
I also uploaded font files created on my PC in stamprite_font.zip file.
Thanks @MartinHanak for sharing this information. I wanted to share an Excel workbook I've created to help me remember how to do this. Sheet 1 acts as a "graph paper" and aids in visualizing the character being drafted in an .SRC file:
(the old Excel chart object lets you click on individual points and drag them for a more interactive experience)
Sheet 2 of this worksheet creates the commands that need to be typed in at the terminal in order to compile your .SRC files and transfer the .FNT file to the correct location
(as you can see, I populated the orange input fields with my Creo4 installation locations; you would have to adapt to your configuration) Afterwards, you can just copy and paste the white cells into the terminal.
@pausob wrote:
Thanks @MartinHanak for sharing this information. I wanted to share an Excel workbook I've created to help me remember how to do this. Sheet 1 acts as a "graph paper" and aids in visualizing the character being drafted in an .SRC file:
(the old Excel chart object lets you click on individual points and drag them for a more interactive experience)
Sheet 2 of this worksheet creates the commands that need to be typed in at the terminal in order to compile your .SRC files and transfer the .FNT file to the correct location
(as you can see, I populated the orange input fields with my Creo4 installation locations; you would have to adapt to your configuration) Afterwards, you can just copy and paste the white cells into the terminal.
Hi,
thank you for uploading Excel file. I was able to open it and modify sample S character.
Note: Unfortunately I do not see the way how to use the tool for letters like A,B,E. (because their definition has several branches).
Well it's not meant to be a FontForge competitor 😄
But these SRC font files are relatively simple.
Just a string of points connected by lines drawn (d) or not drawn (i.e. m for move)
We don't want the "move" to be drawn, so have to put in an empty row above it:
Most of the connections are typically with d-lines, so it is also easy enough to manually format the few m-lines in the chart:
Anyway, I can see how making your fonts with graph paper is also kind of fun, and this is the easy part - compiling and deploying them... that can be quite a nightmare
So frustrating.
Martin your video was exceptionally helpful. I followed this from beginning to end. The only difference was that I had already generated a .ndx file.
When I showed contents of the directory this is what I show.
The only other difference that I could note is that you were able to copy, modify and save the stamprite.src file right in it's folder. In my case I had to move the file in order to make this save, and then return it.
@pimm wrote:
So frustrating.
Martin your video was exceptionally helpful. I followed this from beginning to end. The only difference was that I had already generated a .ndx file.
When I showed contents of the directory this is what I show.
The only other difference that I could note is that you were able to copy, modify and save the stamprite.src file right in it's folder. In my case I had to move the file in order to make this save, and then return it.
Hi,
I guess you do not have full access rights to Creo sub-directories. Therefore you have to copy stamprite.src for example to C:\Users\Public\Documents directory and compile it there.
Yes! Finally.
Changing the directory to user document and following your video closely I was able to verify that the change indeed works.
Thank you for not giving up on this.
Hopefully in the future there will be others that can gain the appreciation of being able to modify the Creo Text Fonts.
The "1" is a little off (it did apply a line though) but I think that perhaps Pausob's follow up might shed some light.
Thanks again!
@pimm wrote:
Yes! Finally.
Changing the directory to user document and following your video closely I was able to verify that the change indeed works.
Thank you for not giving up on this.
Hopefully in the future there will be others that can gain the appreciation of being able to modify the Creo Text Fonts.
The "1" is a little off (it did apply a line though) but I think that perhaps Pausob's follow up might shed some light.
Thanks again!
Hi,
to get corrrect shape of "1", please read again my reply from 2022-06-22 04:34 PM. Also I uploaded modified src file.
---
#49
"1"
width 4
m 2,48
d 2,11
Definition of digit one has width 4, therefore you cannot add another slant line easily.
Maybe you can use definition of digit four which has width 28
#52
"4"
width 28
m 23,11
d 23,47
d 20,47
d 0,27
d 0,24
d 28,24
and use it to create new definition of digit one
#49
"1"
width 28
m 23,11
d 23,47
d 0,27
---
Have you looked at ISOFONT to use as your default font?
The problem with creating your own font file from a SRC is that you would have to include it whenever you send a file out. This is why we went with ISOFONT.
To make your own font from an existing SRC file, just copy the file to a new name.
Make your changes with the M and D commands.
You may need to run compile_font.exe as an administrator.
Ben: I am not set on changing the font name. I just wanted to keep it separate in case I mess something up.
I am thinking that regardless I would need to carry the changes all the way through our department with the initial change as well as any new install down the road.
Leroy was the closest font that we found to our manual stamps but there are some quirks that I would like to change.
Current versions of Creo support true type fonts. You can add a TTF font to the Creo font directory and then use it within Creo for sketches to create text or characters. I have used this in Creo 4+ and it works well.
I do not create the fonts, they come from the design/graphics team but they use the Adobe CS products to create the fonts. Once you load the custom fonts in the directory you should be good to go. I will warn you that the font information is not saved with the part so if someone modifies a feature using the font and they do not have the font installed on their machine it will not regenerate correctly.
Tbraxton: Can you use single line thickness fonts as TTF?
We are looking to use one of the few single line fonts for our default.
Leroy is not perfect but it has the most curvature.