ZioRed Posted April 19, 2010 Share Posted April 19, 2010 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")); Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
ZioRed Posted April 23, 2010 Author Share Posted April 23, 2010 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. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Recommended Posts
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.