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:

Recommended Posts

Hi all,

 

I am using 'get_ttfont_number' function to get a font number. Its mentioned here

 

http://www.emastercam.com/ubb/ultimatebb.p...t=000002#000005

 

It takes a font name and adds it to the font list in Drafting Options(Create->Drafting->Drafting Options) dialog box. I have two questions regarding it.

 

First Q:This function doesn't return the number of the font even if the font is already present in the list. e.g font name "Stick" is already there in the list but when I call get_ttfont_number("Stick", FALSE, FALSE) it adds another entry in the list with name "Stick" and returns 8, instead of 0. Isn't it the wrong behaviour?

 

Second Q: If I do this:

a)Open Create->Drafting->Create note...

b)Click on properties to open the Note Text dialog box

c)On note text dialog box I add a new font by clicking 'Add True Type'(say I added Arial font)

d)Click ok

e)Type something in the note text dialog box

f)Click ok

g)Make a note in the drawing area

h)Start a new file

i)Do steps 'a' to 'g' again with a different font in step 'c'(say Courier New)

 

I don't get the new note in Courier New but in Arial with bad character spaces. Is it a bug?

 

Thanks

Link to comment
Share on other sites

#1 ->

 

The behavior is correct.

 

When I start X2-MR1 and check the Font list (in Create Drafting – Note) I see these (8) fonts listed:

----------

Stick

Roman

European

Swiss

Hartford

Old English

Palatino

Dayville

----------

These are not TrueType fonts.

 

Now by executing a CHook with this code ->

 

int retval1 = get_ttfont_number("Stick", FALSE, FALSE) ;

int retval2 = get_ttfont_number("Stick", FALSE, FALSE) ;

 

int retval3 = get_ttfont_number("Arial", FALSE, FALSE) ;

int retval4 = get_ttfont_number("ARIAL", FALSE, FALSE) ;

 

It reveals that...

 

retval1 = 8

retval2 = 8

retval3 = 9

retval4 = 9

 

By this evidence I’m assuming that I’m adding a TrueType font named “Stick” .

Which is not in the (TrueType)Font List (‘8’ being the next available number in the list) after the “startup” fonts).

If I try to add it again, the system returns ‘8’

 

The same occurs in the sequence of adding ‘Arial’ twice. First time ‘9’ is returned (a new item in the list) and if you attempt to add it again the system returns ‘9’, the number of the already existing font in the list.

 

...and...

Now when I check the Fonts listed (in Create Drafting – Note) after the CHook code has executed, I see that my two fonts are added to the list, as shown ->

----------

Stick

Roman

European

Swiss

Hartford

Old English

Palatino

Dayville

Stick

Arial

------------

 

#2 ->

The font change seemed to work OK for me.

Link to comment
Share on other sites

Roger,

 

If the function get_ttfont_number only returns(or adds) a true type font from the list, then which function should I use to get the number of the default fonts that are present in the list? Or should I hardcode knowing that these fonts always have the same number(e.g the Roman font has number 1 always)?

 

And I am positive about the second problem.I've checked it again. Can it be due to different version number? My version is X2(11.0.3.25)

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...