Display formatted text in direct3d application

I need to display formatted text (colors, different font sizes, underlines, bold, etc.), but I'm not sure how to do this. D3DXFont allows you to immediately display the text of one font / size / weight / color / etc. And I don’t see a practical way to β€œcombine” several calls with ID3DXFont :: DrawText to do such things ...

I looked around, and it seems that there are no existing libraries that do this, but I have no idea how to implement such a text renderer, and I could not even find documentation on how such a text rendering would work only with simple fixed-width, ASCII bitmap fonts that look at it are probably a completely different approach, which is only suitable for rendering simple blocks of text where Unicode doesn't matter.

If this is not done, then are there any other means of rendering (for example, for use in rendering text in a regular window), and whether it will convert the texture to RAM and then upload it to the video card for rendering to the rear buffer give reasonable performance ?

+1
source share
3 answers

You noted this as Direct3D, so I assume this is the target environment. Otherwise, GDI can handle all of this.

, GDI, , , . GDI . , . , , ​​/ , , . ( /, , ..), ::TextOut , , .

Direct3D. ID3DXFont ( , ID3DXFont ), .. , , , ..

, , , , , , .

Windows 7 ( Windows 7), DirectWrite Direct3D (D3D10 ).

+3

Direct3D9 : 1. GDI, HDC, Direct3D , . 2. FreeType , , , GDI, .

, , ClearType Microsoft. ( ). , , ... ClearType, , , . -, Microsoft


Windows XP, Direct2D DirectWrite DirectX10 ( 11). , , Direct2D Direct3D, . - , ID2D1Factory:: CreateDxgiSurfaceRenderTarget

+3

. , , D3DXFont . , / ..,

0

Source: https://habr.com/ru/post/1713637/


All Articles