none
Can't load a font RRS feed

  • Question

  • Hi, this is driving me over the edge... I hope you can help me.

    This runs absolutely without error if i have the directx sdk installed, i've had it running on 3 machines with the sdk on it, but i want it to run on machines without the damned sdk. If there isn't an sdk on the machine, then this line of code:

    Microsoft.DirectX.Direct3D.System.Drawing.Font winFont = new System.Drawing.Font(FontFamily.GenericSansSerif, 14);
    Microsoft.DirectX.Direct3D.Font d3dFont =
    new Microsoft.DirectX.Direct3D.Font(renderDevice, winFont);

    or


    Font
    d3dFont = new Microsoft.DirectX.Direct3D.Font(renderDevice, 12, 0, FontWeight.Normal, 0, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.DefaultPitch, "Arial");


    Results in this hopeless error:

    An unhandled exception of type 'System.IO.FileNotFoundException' occurred in ParPhysDirectX.exe
    Additional information: The specified module could not be found. (Exception from HRESULT: 0x8007007E)


    I must be missing some kind of assembly, dll or whatever, i just don't have any clue as to where to look.... Arial is installed on the machine where i'm trying to run the app. All machines involved are running windows xp with directx9.0c installed. I have copied:

    Microsoft.DirectX.Direct3D.dll
    Microsoft.DirectX.Direct3DX.dll
    Microsoft.DirectX.DirectInput.dll
    Microsoft.DirectX.dll

    with the executables, but loading the font must need some other dll..... Please help...
    • Edited by Niz0r Monday, May 18, 2009 5:13 AM bad formatting
    Monday, May 18, 2009 5:12 AM

Answers

  • Managed DirectX (MDX) isn't installed as part of the .NET Framework. You'll have to provide with your program the appropriate DirectX redist installer since, as far as I know, the EULA doesn't allow you to directly include the DirectX DLLs with the program. MDX is basically defunct so the best option is to go to download one of the older redistributables and use that:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=136A7B29-AA12-4C3B-AA7D-15CD98A9A59C&displaylang=en
    • Marked as answer by YiChun Chen Monday, May 25, 2009 3:53 AM
    Tuesday, May 19, 2009 5:04 AM
  • Well if you don't mind taking the trouble to port it then for sure XNA is an option. For the managed languages there's also SlimDX which is probably more closely related to MDX than XNA. They both have their pros and cons. Research them both and decide which is easier for you.
    • Marked as answer by YiChun Chen Monday, May 25, 2009 3:53 AM
    Tuesday, May 19, 2009 8:54 AM

All replies

  • Managed DirectX (MDX) isn't installed as part of the .NET Framework. You'll have to provide with your program the appropriate DirectX redist installer since, as far as I know, the EULA doesn't allow you to directly include the DirectX DLLs with the program. MDX is basically defunct so the best option is to go to download one of the older redistributables and use that:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=136A7B29-AA12-4C3B-AA7D-15CD98A9A59C&displaylang=en
    • Marked as answer by YiChun Chen Monday, May 25, 2009 3:53 AM
    Tuesday, May 19, 2009 5:04 AM
  • Ok, thx. Guess i'll have to start porting then :) It's all in XNA now? Or is something else on the horizon?
    Tuesday, May 19, 2009 8:03 AM
  • Well if you don't mind taking the trouble to port it then for sure XNA is an option. For the managed languages there's also SlimDX which is probably more closely related to MDX than XNA. They both have their pros and cons. Research them both and decide which is easier for you.
    • Marked as answer by YiChun Chen Monday, May 25, 2009 3:53 AM
    Tuesday, May 19, 2009 8:54 AM