Jump to content

[SOLVED] Loading a font


ZioRed
 Share

Recommended Posts

I have tried to load a font with the following statement (I haven't understood what is and how to value the last parameter "charset", I tried with "0" and "1" and saw no difference):

 

Font font = Font.Load("abstract::Arial12Shadow", 10, 0, 0);

 

This line causes the following error:

 

A call to PInvoke function 'Leadwerks!Leadwerks.Core::LoadFont' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

 

Now the problem seems to be in the source when calling Core.LoadFont(path, size, flags, charset)

 

Anyone has the font loading working with the last wrapper headers?

 

PS: with the C++ code it works:

SetFont(LoadFont("abstract::Arial12Shadow"));

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Problem solved, it seems that there is an unknown (to me) declaration of LoadFont in the wrapper, so I changed it on the wrapper and all works now (last headers 1.3b released by klepto2):

 

File: /Leadwerks/Leadwerks.cs, Line 991:

//public static extern IntPtr LoadFont(string _name, int _size, int _flags, int _charset);
public static extern IntPtr LoadFont(string _name);

 

File: /Leadwerks/Font.cs, Line 19:

//return new Font(Core.LoadFont(path, size, flags, charset));
return new Font(Core.LoadFont(path));

 

So the call to Font.Load now requires only FontPath as it is documented in the engine.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

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.
Note: Your post will require moderator approval before it will be visible.

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

×
×
  • Create New...