Text3D Transform

Turns a given text string into a three-dimensional (3-D) model. This transform takes no inputs and produces a 3-D mesh output that is an extruded version of the two-dimensional (2-D) font.

All the information needed to produce the output, such as the text string, font face, and letter spacing, is selected by setting the transform properties listed below.

Note  To use this transform, you need to have Microsoft Windows® 98 Second Edition or Windows 2000 installed.

Transform Specifications

The following table contains the information you need to use this transform in C++ and script.

Class identifier (CLSID) CLSID_Text3D
Globally unique identifier (GUID) D56F34F2-7E89-11d2-9B4E-00A0C9697CD0
Programmatic identifier (ProgId) DX3DTransform.Microsoft.Text3D
Category identifier (CATID) CATID_DX3DTransform
Custom interfaces IDXTText3D
Supported interfaces None
Inputs None
Output Direct3DRMMeshBuilder3

Custom Properties

The following table lists the custom properties that control the transform output.

Property Type Default Description
String BSTR 3D The string that will be converted to a 3-D mesh.
FontFace BSTR Arial A list adapted from the Cascading Style Sheet (CSS) font-family attribute. The list is comma-separated and each item is the name of either a specific TrueType font (for example, Times New Roman) or a generic font family. The first font that is available on the system is chosen. The recognized generic families are Cursive, Fantasy, Monospace, Sans-serif, and Serif.
FontWeight BSTR normal The weight to use in rendering the font. Valid values are normal, bold, 100, 200, 300, 400, 500, 600, 700, 800, 900. The value normal is the same as 400, and the value bold is the same as 700. Depending on the font, a certain range of weights might be mapped to a single weight, so this property should be viewed only as a guideline.
FontStyle BSTR normal The style of the font. Valid values are normal, italic, and oblique. Currently oblique is identical to italic.
ExtrusionType BSTR Simple The type of extrusion. Valid values are Simple for simple extrusion or FlatBevel for flat beveled extrusion.
Vertical Boolean FALSE The direction in which the letters of the string are created. If TRUE, the string is written vertically; otherwise, it is written horizontally.
LetterSpacing VARIANT 0.0 The amount of spacing between each character that is added to the usual spacing.
XAlign BSTR center The point in the output that lies at x = 0. Valid values are left (for the left edge), center (the center point), and right (the right edge).
YAlign BSTR baseline The point in the output that lies at y = 0. Valid values are top, center, bottom, ascent, baseline, and descent. For the last three values, if Vertical is TRUE, the transform uses the ascent, baseline, or descent of the first character.
ZAlign BSTR center The point in the output that lies at z = 0. Valid values are front, center, and back.
Quality float 0.125 A value that controls the tessellation of the curved parts of the font, and hence the number of triangles in the generated 3-D mesh.

Remarks

Many programs support concatenating the FontFace, FontWeight, and FontStyle properties into one string, such as Arial Bold Italic, applied to the FontFace property. However, the preferred method for this transform is to set each property explicitly, as shown in the following example.

t.FontFace = "Arial"; 
t.fontWeight = "Bold"; 
t.FontStyle = "Italic";

All consecutive white space in the list is treated as a single space. Initial and terminal white space is ignored. If you want to protect literal white space and commas in a font name, you can use apostrophes around the name.

If none of the fonts specified in the list exists on the client's system, the transform arbitrarily chooses one of the TrueType fonts installed on the system. If a character has no representation in the given font, a space, question mark, or box will appear in its place. To make certain that all users will be able to view the transform output properly, it is best to select one of the standard TrueType fonts included with Windows, such as Arial, Verdana, or Times New Roman.

The following table lists examples values for the FontFace property, along with the font selection that results from the string.

FontFace Result
"Courier New" A specific type face.
"fantasy" A generic font family.
"Garamond, Times New Roman, serif" A prioritized list.
"No Font, nevermind" A presumably unrecognized value. The transform will use the system's default TrueType face.
"" An empty string. The font continues to be the current value.
" Courier New , Times New Roman " Same as "Courier New, Times New Roman"
" 'Nine , light years'" The comma and spaces between words are taken literally.

This transform relies on support from the operating system for interpreting the input string. Thus, Japanese fonts will display correctly for computers with the Japanese version of Windows 98, Arabic fonts will display correctly for computers with the Arabic version of Windows 98, and so on. A U.S. computer with a Japanese language pack might render many Japanese inputs correctly, but composite characters and other special language features will not work.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.