AB4D Forum

Full Version: Special characters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to render my native language special characters like 'ąćę...' with Model3DFactory.Instance.CreateTextGeometry (or other classes)?
With CreateTextGeometry it is not possible to use any other fonts or characters.

If you need to use any font, than you can create a 3D Plane and set VisualBrush as its Material and / or BackMaterial. The content of VisualBrush would be a TextBlock that could display any text in any TrueType font. Check the web for more info - in Net 4.0 there are also some additional optimization options.

Another possibility is to prepare an image with your text - use RenderTargetBitmap to render TextBlock into an image and use that image as Material and BackMaterial for 3d rectangle. This is used in Cannon ball simulation that comes with Ab3d.PowerToys. There a HorizontalPlaneVisual3D is used and than a StackPanel with TextBlocks is rendered into bitmap that is than used as an ImageBrush for the 3D plane.
I have already tried the RenderTargetBitmap approche, but the performance was not satisfactioning. I will check now the VisualBrush, but as far as I know its one of the slowes brushes.

Thanks for the tips.
Why was performance bad with RenderTargetBitmap approche? This should be the most efficient approach - showing a texture on a plane (2 triangles) is a basic operation for graphics card.

Maybe you created too big texture - here the VisualBrush can provide some optimizations with caching textures.
Yes, my textures were pretty big like (200x1000 px), because I needed them to be readable from far away. So hundred of those just eate all the memory.