|
|
Up |
|
|
  |
Author: Justus JonasJustus Jonas Date: Aug 2, 2008 08:37
Hi,
i have a problem regarding DirectX9 Fonts, what i wanted to do is display
some text on the screen. So i created my font with this line of code:
V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 55, 0, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH |
FF_DONTCARE,
TEXT("Helvetica 65 Medium"), &g_myfont9 ));
and a second font to test stuff was
V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 200, 0, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
TEXT("Arial"), &g_myfont9_big ));
this one. Now when i render some text with the first font (g_myfont9), i
have no space between the letters, its all clamped up, the second (which is
Arial...) works fine. When i use the Helvetica font in Word for example, it
works fine.
Is there a way to manually get some space between the characters, or do i
have to do it manually (by doing " " in between for example).
Thanks in advance.
|
| |
|
| | 10 Comments |
|
  |
Author: Justus JonasJustus Jonas Date: Aug 2, 2008 08:40
"Justus Jonas" nowhere.com> schrieb im Newsbeitrag
news:Ozb3tWL9IHA.3848@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> i have a problem regarding DirectX9 Fonts, what i wanted to do is display
> some text on the screen. So i created my font with this line of code:
>
> V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 55, 0, FALSE,
> DEFAULT_CHARSET,
> OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH |
> FF_DONTCARE,
> TEXT("Helvetica 65 Medium"), &g_myfont9 ));
>
> and a second font to test stuff was
>
> V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 200, 0, FALSE,
> DEFAULT_CHARSET,
> OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
> TEXT("Arial"), &g_myfont9_big ));
> ...
|
| Show full article (1.26Kb) |
|
| | no comments |
|
  |
Date: Aug 3, 2008 18:32
[Please do not mail me a copy of your followup]
"Justus Jonas" nowhere.com> spake the secret code
thusly:
>i have a problem regarding DirectX9 Fonts, what i wanted to do is display
>some text on the screen. So i created my font with this line of code:
>
>V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 55, 0...
|
| Show full article (1.25Kb) |
| no comments |
|
  |
Author: Justus JonasJustus Jonas Date: Aug 4, 2008 01:55
"Richard [Microsoft Direct3D MVP]" mail.xmission.com>
schrieb im Newsbeitrag news:eOhuFId9IHA.6052@TK2MSFTNGP04.phx.gbl...
> [Please do not mail me a copy of your followup]
>
> "Justus Jonas" nowhere.com> spake the secret code
> thusly:
>
>>i have a problem regarding DirectX9 Fonts, what i wanted to do is display
>>some text on the screen. So i created my font with this line of code:
>>
>>V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 55, 0, FALSE,
>>DEFAULT_CHARSET,
>> OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH |
>>FF_DONTCARE,
>> TEXT("Helvetica 65 Medium"), &g_myfont9 ));
>>
>>and a second font to test stuff was
>>
>>V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 200, 0, FALSE,
>>DEFAULT_CHARSET, ...
|
| Show full article (1.60Kb) |
| no comments |
|
  |
Date: Aug 4, 2008 13:44
[Please do not mail me a copy of your followup]
"Justus Jonas" nowhere.com> spake the secret code
thusly:
>I just installed the new SDK, the text is still totally messed up, it's
>neither the text i gave to display nor is there any spacing between the
>letters.
Please post the code you're using to draw the text and tell me if
you're compiling in ANSI or UNICODE.
|
| |
| no comments |
|
  |
Author: Justus JonasJustus Jonas Date: Aug 5, 2008 05:10
I have no idea whether i am using ANSI or UNICODE, and no clue where to find
out about that.
Font creation:
V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 100, 0, FALSE, ANSI_CHARSET,
OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH |
FF_DONTCARE,
TEXT("Helvetica 45 Thin"), &g_myfont9 ));
V_RETURN( D3DXCreateFont( pd3dDevice, 30, 0, 100, 0, FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
TEXT("Arial"), &g_myfont9_big ));
Displaying and creating the text:
|
| Show full article (2.65Kb) |
| no comments |
|
  |
Date: Aug 5, 2008 11:37
[Please do not mail me a copy of your followup]
"Justus Jonas" nowhere.com> spake the secret code
<#9I21Qv9IHA.5404@TK2MSFTNGP04.phx.gbl> thusly:
>I have no idea whether i am using ANSI or UNICODE, and no clue where to find
>out about that.
Look in your project settings and check your preprocessor definitions
-- you should be setting UNICODE or _UNICODE for wide character builds.
I'm guessing you're using wide character builds because this line
compiles:
> ::MultiByteToWideChar( CP_ACP, NULL, name2, -1, wText,len );
> // Draw some text
> g_myfont9_big->DrawText(NULL, wText, -1, &rct, 0, fontColor );
That implies that you're building unicode because you're feeding a
wide-character pointer to DrawText and it isn't complaining when you
compile it.
|
| Show full article (1.19Kb) |
| no comments |
|
  |
Author: Justus JonasJustus Jonas Date: Aug 5, 2008 15:08
> Look in your project settings and check your preprocessor definitions
> -- you should be setting UNICODE or _UNICODE for wide character builds.
>
> I'm guessing you're using wide character builds because this line
> compiles:
>
it is indeed Unicode
> I wonder if you're getting the proper results from
> MultiByteToWideChar; have you tried just calling DrawText with
> something like a TEXT() constant containing the kind of typical string
> you want to draw?
g_myfont9->DrawText(NULL, L"Text Test\n Test 233", -1, &rct, 0, fontColor );
this is the line i just tested, works fine with Arial, doesnt work with
Helvetica 55 Roman
Another thing just happened, when i start the program in full screen mode,
its flickering, which it shouldnt. This is another problem, but what could i
do about that?
|
| |
| no comments |
|
  |
Author: Justus JonasJustus Jonas Date: Aug 5, 2008 15:12
nevermind that flickering, i found out where that came from, still having
the problem with the font though. I could use Arial, but i had a designer
make that layout, and he specifically used Helvetica ;)
|
| |
| no comments |
|
  |
|
|
  |
Date: Aug 5, 2008 16:39
[Please do not mail me a copy of your followup]
"Justus Jonas" nowhere.com> spake the secret code
<#BIihf09IHA.2196@TK2MSFTNGP05.phx.gbl> thusly:
>it is indeed Unicode
>
>> I wonder if you're getting the proper results from
>> MultiByteToWideChar; have you tried just calling DrawText with
>> something like a TEXT() constant containing the kind of typical string
>> you want to draw?
>
>g_myfont9->DrawText(NULL, L"Text Test\n Test 233", -1, &rct, 0, fontColor );
>
>this is the line i just tested, works fine with Arial, doesnt work with
>Helvetica 55 Roman
I would say then that the problem appears to be something specific to
this font, so let's look closer at the font.
|
| Show full article (1.00Kb) |
| no comments |
|
|
|
|