Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom SHX font overlapping problem

12 REPLIES 12
Reply
Message 1 of 13
imuckyu
800 Views, 12 Replies

Custom SHX font overlapping problem

I am trying to create a custom SHX font from a SHP file using the COMPILE command.

 

I have specified the base insertion point when I created the SHP file.

When I try to test the SHX font it seems to just place all the letters on top of eachother. (basically all at the same point)

 

Is there a way to avoid this? I assume I need to have some kind of parameter to specify the distance between each letter? Like a start and end point?

12 REPLIES 12
Message 2 of 13
pendean
in reply to: imuckyu

Share your SHP file here please.
Message 3 of 13
imuckyu
in reply to: pendean

Here you go - I only made the letters A, B and C here.

 

https://drive.google.com/file/d/1PwyAKP3rP6nLgP_EkEZhn0D91p6hSqpE/view?usp=sharing

(for some reason I can't attach .shp file directly so here is a Gdrive link)

Message 4 of 13
Kent1Cooper
in reply to: imuckyu


@imuckyu wrote:

.... I assume I need to have some kind of parameter to specify the distance between each letter? Like a start and end point?


You need to finish each character with a 002 pen-up code followed by a displacement [or sometimes more than one, depending on where on the character its definition ends], to move over to where the next character should start.

 

And if I may say so, those definitions looks quite complex given the simplicity of the characters in your image.  The 4 and 3 multiplier/divider codes piled on each other seem convoluted, though I didn't study it all in detail.

Kent Cooper, AIA
Message 5 of 13
imuckyu
in reply to: Kent1Cooper

Where exactly can I specify the 002 pen-up code?

 

In the MAKESHP command it only asks for name, resolution and base insertion point.

 

Or do I need to add that code manually in the .shp code later?

How do I do that/What kind of code would I enter? Where can I read more about this?

Message 6 of 13
Kent1Cooper
in reply to: imuckyu

Read about the special codes >here<, and look at the parent topic "About Shape descriptions" one up from there, as well as other related topics.

 

The big difference between font character definitions and shape definitions is the inclusion of the move-over-to-where-the-next-character-starts code at the end of font characters, which shape definitions don't need.  That's why using MAKESHP doesn't define the shape correctly for use as a character in a font.

Kent Cooper, AIA
Message 7 of 13
imuckyu
in reply to: Kent1Cooper

Thanks for the link. I had a look at it.

In general I understand the overall concept (About Shape Descriptions)

*shapenumber,defbytes,shapenamespecbyte1,specbyte2,specbyte3,...,0

 

For the start/end position part I am still a bit confused. Do you happen to have an example?

 

So my current approach (below) is not the way to go then, is that correct?

 

1) Draw Letter
2) MAKESHP command => export as .shp

3) Change the shapenumber etc. manually in a text editor
4) COMPILE command => select previous .shp file => generate .shx file

 

Or should I use a different command/approach here?

 

Message 8 of 13
Kent1Cooper
in reply to: imuckyu

If you're talking about making a font file, you also need to add the step of editing each shape definition to lift the pen and move over to where the next character would start.  Here's the definition of the upper-case A in the ROMANS font:

 

*00041,39,uca
2,14,8,(-9,-21),14,5,8,(9,21),1,8,(-8,-21),2,8,(8,21),1,
8,(8,-21),2,8,(-13,7),1,0A0,2,8,(4,-7),14,6,14,8,(9,-9),0

 

The 2 is lifting the pen after drawing the last element in the character.  The 8,(4,-7) is the move [over 4 units and down 7] to get the pen location to where the next character would start.

 

In the case of AutoCAD's .shx fonts, they're designed for the possibility of vertically-running text in a Style definition, which is what the 14's are about [14 is the same as 00E -- look at that in the Special-Codes page].  So this is more complex than you probably need -- the stuff after that pen move, with the 14's, is ignored if the Style is not set to run vertically, except for the concluding 0.

Kent Cooper, AIA
Message 9 of 13
imuckyu
in reply to: Kent1Cooper

Thank you that is very helpful!

 

One other question - how were you able to read the definition of the A letter from the ROMAN font?

 

When I open the .shx file in a text editor it shows unreadable text.

 

I can't find a .shp file that I could open. Or did you convert the .shx file to .shp format? If yes, how?

Message 10 of 13
cadffm
in reply to: imuckyu
Message 11 of 13
imuckyu
in reply to: cadffm

hm I do have ExpressTools installed but it does not show the DUMPSHX option (also not in the console)

Message 12 of 13
cadffm
in reply to: imuckyu

"We" are talking your harddrive, the command console! [WIN]+[R]  Open: CMD

 

CADffm_2-1687561752652.png

 

 

 

CADffm_0-1687561605784.png

 

for example if you like to dump a "d:\temp\romans.shx" file:

CADffm_1-1687561661472.png

 

Sebastian

EESignature

Message 13 of 13
imuckyu
in reply to: cadffm

Ahh - thanks a lot. That worked!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta