---
title: "Overview of Text Drawing"
canonical: https://www.graphicsmill.com/docs/gm5/OverviewofTextDrawing.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Overview of Text Drawing
 
Text rendering is a very important task applied to various types of software. Graphics Mill for .NET implements this functionality and provides a lot of adjustments to display the desired text. Using Graphics Mill for .NET you can draw both single-line and multiline text on RGB, indexed or grayscale images. It is also possible to draw text on a CMYK bitmap but it requires additional steps described in the [Drawing Text on a CMYK Bitmap](https://www.graphicsmill.com/docs/gm5/DrawingTextonaCMYKBitmap.htm.md) article.
 
**Note** 
When you try to draw text on a grayscale bitmap, you will notice that the text is not antialiased. The reason of this problem is that neither GDI nor GDI+ support grayscale bitmaps, therefore Graphics Mill for .NET has to imitate it as indexed bitmap with grayscale palette. However, antialiasing is impossible on indexed bitmaps.
 
Graphics Mill for .NET provides the possibility to make your text more attractive by applying some effects: shadow, glow, 3D, etc. See the [Drawing Text with Effects](https://www.graphicsmill.com/docs/gm5/DrawingTextwithEffects.htm.md) topic for detailed information and samples on how to draw text with such effects. One more way to make your text eye-catching is to outline it using any approach described in the [Drawing Text with Outline](https://www.graphicsmill.com/docs/gm5/DrawingTextwithOutline.htm.md) article.
 
To draw text with Graphics Mill for .NET you will need to use the [Font](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Font.htm.md) and [GdiGraphics](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md) classes. Let us consider them more detailed.
 
## The Font Class
  
This class provides an access to font and text rendering settings. They include:
 
- [Name](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Name.htm.md) and [Size](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Size.htm.md) properties to specify typeface name of the font and its size;
- [Bold](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Bold.htm.md), [Italic](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Italic.htm.md), [Underline](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Underline.htm.md), and [Strikeout](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Strikeout.htm.md) properties to highlight the text;
- [Antialiased](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Antialiased.htm.md) property to make the text smooth;
- [HorizontalAlignment](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_HorizontalAlignment.htm.md) and [VerticalAlignment](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_VerticalAlignment.htm.md) properties to specify how to locate text relative to the drawing coordinates.

The Font class also implements functionality to retrieve font metrics, and other font-related information. For example:
 
- If you need to get a rectangle the multiline text with given settings will occupy you can use this class as it is described in the [Measuring Text Size](https://www.graphicsmill.com/docs/gm5/MeasuringTextSize.htm.md) article.
- To get individual positions of each character in the single-line text, you can use [GetCharacterPositions(String, Single)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_Font_GetCharacterPositions_2_1dbfa9fa.htm.md) method. See the detailed information on it in the [Measuring Characters Positions](https://www.graphicsmill.com/docs/gm5/MeasuringCharactersPositions.htm.md) topic.
- If you need more advanced calculations, this class provides you with a number of font metrics described in the [Text Coordinates and Font Metrics](https://www.graphicsmill.com/docs/gm5/TextCoordinatesandFontMetrics.htm.md) article.

There are two ways to set a font in Graphics Mill for .NET. The first way is to specify font family name, size and boolean values indicating whether the rendered text is bold, italic, underlined and so on. The second way is to use a PostScript name of the font installed on the computer. To apply the first one you can use any [constructor](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_Font_ctor.htm.md) of the Font class. The second one can be applied using the [Font.CreateSpecificFont(String, Boolean, Single)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_Font_CreateSpecificFont_3_18dd7ff5.htm.md) static method which returns the font with the requested name. The PostScript format is commonly used in Adobe applications. So this way can be suitable to raster text layers extracted from PSD files using Advanced PSD Add-on.
 
## The GdiGraphics Class
  
This class represents drawing functionality provided by Graphics Mill for .NET. It implements three overloaded methods to draw a text:
 
- [DrawString](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawString.htm.md) methods draw single-line and outlined text. See [Drawing Text String](https://www.graphicsmill.com/docs/gm5/DrawingTextString.htm.md) article to obtain the details on how to draw text using this method.
- [DrawText](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawText.htm.md) methods draw single-style multiline text. The [Drawing Multiline Text](https://www.graphicsmill.com/docs/gm5/DrawingMultilineText.htm.md) article contains the detailed information about multiline text drawing.
- [DrawFormattedText](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawFormattedText.htm.md) methods provide a possibility to render multi-style text. It means that text can include portions rendered using different font settings. To specify style for each portion text should be marked up using certain rules. These rules are completely described in the [Drawing Formatted Text](https://www.graphicsmill.com/docs/gm5/DrawingFormattedText.htm.md) article.
