Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Character width


Recommended Posts

‘Character Width’ is only active with ‘Spacing’ is set to ‘Fixed’.

 

I cannot say for sure without further digging, but I’d assume that data is stored in the font_attr structure.

 

The Drafting stuff is declared in DfVars_CH.h.

 

Now type depending on what you’re dealing with; a Note (v8_note) or Dimension (v8_dim_txt)…

Each of those types contains a font_attr structure.

So you drill down thru the ‘ent’…

For a ‘note’: ent.u.n.params [data item in font_attr]

For a ‘dimension’: ent.u.dm.n.params [data item in font_attr]

To find which [data item in font_attr], I would plug in some unique value for that setting and then look at (in the debugger) what's loaded in the font_attr struct for that ent.

Link to comment
Share on other sites

Thanks Roger!

 

I'm working with Notes (v8_note).

The structure font_attr is defined

 

code:

typedef struct

{

p_2d center; /**< center point of arc */

double str_rot; /**< string rotation angle */

double slant; /**< slant angle */

double chr_rot; /**< character rotation angle */

double height; /**< height of character */

double chr_exp; /**< character expansion factor(based on height)*/

double extra_sp; /**< extra char. space facter per unit of height*/

double extra_ln_sp; /**< extra line space factor */

double alt_height; /**< height of character */

double alt_chr_exp; /**< alt char. expansion factor(based on height)*/

/* 2 bytes */

unsigned short alt_color:4; /**< draw color */

unsigned short fill_color:4; /**< fill color */

unsigned short h_txt_aln:2; /**< hort. align.(0-left,1-center,2-right)*/

unsigned short v_txt_aln:3; /**< vert. align.(0-top,1-cap,2-half,3-base,

4-bottom) */

unsigned short path:3; /**< text path (0-right,1-left,2-up,3-down,

4-arc CW, 5-arc CCW); */

/* 2 bytes */

unsigned short space_sty:1; /**< spacing style(0-fixed,1-proportional)*/

unsigned short fill:1; /**< fill region flag */

unsigned short mirror:2; /**< mirror flag (0-no mirror, 1-mirror x,

2-mirrory,3- mirror both)*/

unsigned short filler:12; /**< not used at present, here for alignment */

/* 4 bytes */

MC_BYTE font; /**< display font */

MC_BYTE alt_font; /**< alternate display font */

MC_BYTE text_bx; /**< text box draw flag for top */

MC_BYTE pad; /**< Pad end of structure */

} font_attr;

The 'Character Width' must be one of those elements but don't know which one.

 

--Titus

Link to comment
Share on other sites

Note in the Drafting Options dialog the interplay between the Aspect Ratio and the Character Width.

 

*When the Spacing Mode is ‘Fixed’ ->

The Aspect Ratio field is grayed-out and Character Width is active.

Notice when you change the Character Width that the value of Aspect Ratio changes.

 

*When the Spacing Mode is ‘Proportional’ ->

The Character Width field is grayed-out and is Aspect Ratio active.

Notice when you change the Aspect Ratio that the value of Character Width changes.

 

So you see that these 2 settings (on the dialog ) are ‘linked’.

Some experimentation shows us that the ‘link’ is -> Aspect Ratio = width/height.

 

With…

Width = Character Width

Height = Text Height

 

*In the end we see that Character Width is not stored and it is the Aspect Ratio value is that gets written to the font_attr struct data in chr_exp.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...