Applications can use the EnumFonts and EnumFontFamilies functions to enumerate the fonts in a printer-compatible memory device context. An application can also use the GetDeviceCaps function to retrieve information about the text capabilities of a device. By calling the GetDeviceCaps function with the NUMFONTS index, an application can determine the minimum number of fonts supported by a printer. (An individual printer may support more fonts than specified in the return value from GetDeviceCaps with the NUMFONTS index.) By using the TEXTCAPS index, an application can identify many of the text capabilities of the specified device.
The following example uses the GetDeviceCaps function to determine whether a device supports text rotation:
int result;
result = GetDeviceCaps(hdc, TEXTCAPS);
if (result & TC_CR_90)
TextOut(hdc, 10, 100, "Device can rotate text 90 degrees", 33);
if (result & TC_CR_ANY)
TextOut(hdc, 10, 120, "Device can rotate text at any angle", 35);
else if ((result & TC_CR_90) == 0 && (result & TC_CR_ANY) == 0)
TextOut(hdc, 10, 100, "Device cannot rotate text", 25);