• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Fonts ressource ID3DXFont adding its hown font

## Recommended Posts

to ensure that the dungeon fonts will be really present on all system I try to add it. the problem is that all work well but it doesn''t show on a computer that doesn''t have it installed in system/fonts firectory. I add the font at the start of my program with: AddFontResource("Mydir/dungeon.ttf") all is well it return "1" indicating that the font is added Later to ensure that the font is present I: EnumFonts(hdc,0, FontProc, 0); All is well the dungeon show at the end of the list But now with:
LOGFONT log_font={
20, //height
0,  //width;
0,  // lfEscapement;
0,  //lfOrientation;
FW_BOLD, // lfWeight;
FALSE, // lfItalic;
FALSE, // lfUnderline;
FALSE, // lfStrikeOut;
ANSI_CHARSET, // lfCharSet;
OUT_DEFAULT_PRECIS, //lfOutPrecision;
CLIP_DEFAULT_PRECIS, // lfClipPrecision;
ANTIALIASED_QUALITY|PROOF_QUALITY,// lfQuality;
DEFAULT_PITCH,// lfPitchAndFamily;
"Dungeon"// lfFaceName[LF_FACESIZE];
};
hr=D3DXCreateFontIndirect(m_pd3dDevice,&log_font,&m_pFont);
[/Code]

It never show. instead it display what I think should be arial unless I install the font in the "System/fonts"
directory....

Can I provide myself this font with my program and install it without problemes in the /%System%/Fonts directory ?
instead of doing previous wich don''t work ?

any hints/thought/idea ?

Dan    

##### Share on other sites
G''day!

This is one of the big reasons I advocate using a font texture rather than using D3DXFont. If I install a game, I don''t want it messing with my system directory.

Are you linking with the debug version of D3DX? It may spit out some hints as to why it didn''t work.

Also, if you really want to use your font, you should look at CD3DFont instead since it''s MUCH faster. And it ships with the SDK.

If you''re interested in checking out the font texture method, go to: http://www.drunkenhyena.com/docs/dhFastFont.phtml

Stay Casual,

Ken
Drunken Hyena

##### Share on other sites
Hello Drunken,

wich worked fine on my p400. Howewer if its possible I want to avoid using such class for some reason.
-I don't need customisable font and all my menu work already great with d3dxfont. (slow yes but I don't care for menu) While this part is already done I'm in concern rewriting code to get the same result.

Howewer Do you plan to release only the font class with source

There is surelly a way to use font even not in the .../fonts directory. But as I said all seem OK the font is listed as the other font when I do an ENUM but it symply does not show.

Not sure but it seem that I didn't had this problem with the CD3Dfont wich I tested before so it may be a CD3DXfont trouble.
Else I just plan to add the dungeon font wich seem installed everywhere already or I'm wrong ?
I will push the debug cursor to the max to see if it show something and I will test with my saved CD3Dfont project
to see if the problem is the same.

My test may be delayed somewhat, my wife is pregnant and I think I will have a litle girls tonight :-)

Dan
"happy"

Edited by - dansteph on November 7, 2001 2:58:24 PM

##### Share on other sites
G''day!

quote:
Original post by dansteph
While this part is already done I''m in concern rewriting code to get the same result.

The changes required are very minor to switch between D3DXFont, CD3DFont and my dhFastFont. If you have a look at the sample program that comes with my class you''ll see how trivial it is.
quote:

Howewer Do you plan to release only the font class with source

It''s just a header file. Nothing to link to, just include it, so all the source is there.
quote:

Else I just plan to add the dungeon font wich seem installed everywhere already or I''m wrong ?

I don''t have it installed on my system, I''m sure many other people don''t.
quote:

My test may be delayed somewhat, my wife is pregnant and I think I will have a litle girls tonight :-)

Congrats! I don''t have any kids, but I have 3 wonderful nieces and I love them more than anything.

Stay Casual,

Ken
Drunken Hyena

##### Share on other sites
quote:

It''s just a header file. Nothing to link to, just include it, so all the source is there.

Oh I missed that I never included code in the header file.

I will consider using your class I have also menu that may be displayed in the loop game and performance will be a +

I will do some previous test while there is just a glitch with the "I" and the "L" in the fastfont4 demo (there display 1 pixel up on my tnt2)

Wrong alert the litle girl didn''t come last night... :-)

Dan

• ### Forum Statistics

• Total Topics
628281
• Total Posts
2981801

• 10
• 11
• 17
• 14
• 9