Spread enables you to use GDI (instead of GDI+) for drawing text in your application, by incorporating the FarPoint.Win.TextRenderer.dll assembly into your project. The assembly must be added to your project references and placed in the same directory as the application's executable file (the bin folder) where GDI drawing is preferred. Alternatively, the file may be installed to the Global Assembly Cache(GAC) to ensure that all Spread controls in all applications will use the TextRenderer for text drawing.
The FarPoint.Win.TextRenderer.dll is designed as a thin wrapper around the TextRenderer class within System.Windows.Forms namespace, allowing Spread to use GDI for text drawing instead of GDI+. When the application is running, it attempts to locate the FarPoint.Win.TextRenderer.dll assembly. If found, Spread uses reflection to make dynamic calls into assembly for text drawing with System.Windows.Forms.TextRenderer class. If the FarPoint.Win.TextRenderer.dll or the TextRenderer class is not found, then Spread defaults to using GDI+ which uses Graphics.DrawString method within System.Drawing namespace to draw text.
For detailed differences between Microsoft TextRenderer and Graphics.DrawString methods , refer to the .NET Framework documentation.
To prevent the usage of the FarPoint.Win.TextRenderer assembly for rendering the text, you can use UseGDITextRendering property of the TextHelper class of the FarPoint.Win.Text namespace. This property is true by default. However, if you encounter any text rendering issues, you can disable the property.
You can use the code implementation of UseGDITextRendering with another code in your application. The code for UseGDITextRendering is described below:
C# |
Copy Code
|
---|---|
// Set the UseGDITextRendering to false TextHelper.UseGDITextRendering = false; |
VB |
Copy Code
|
---|---|
' Set the UseGDITextRendering to false TextHelper.UseGDITextRendering = False |
However, you can also set UseGDITextRendering property to true depending upon the specific needs of your application.