We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GDI Font Issues

Thread ID:

Created:

Updated:

Platform:

Replies:

19490 Sep 27,2004 03:50 PM Sep 30,2004 01:04 PM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 27, 2004 03:50 PM

If using GDI to draw text on a grid, the draw does not limit the text area drawn to the cell rectangle. Please see the attached example in which GDI text overflows (vertically) into other cells whereas pressing the GDI+ button limits the text ot just the currenct cell. GDIFont_9823.zip Thanks, Steve

Administrator [Syncfusion]
Replied On September 29, 2004 09:42 AM

I forgot to mention that I am using 2.1.0.30. Have you duplicated this issue in your system? Thanks, Steve

Administrator [Syncfusion]
Replied On September 29, 2004 01:44 PM

Hi Steve, we''ll add a ForceDrawText field to GridGDIPaint Here is how you can workaround it for now: protected override void OnDrawCellDisplayText(GridDrawCellDisplayTextEventArgs e) { base.OnDrawCellDisplayText (e); if (UseGDI) { // in future versions: // GridGdiPaint.ForceDrawText = true; // -or- // e.Style.Trimming = System.Drawing.StringTrimming.Character; // Workaround for now: e.Style.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; // but this draws also ellipsis at end ... e.Cancel = GridGdiPaint.Instance.DrawText(e.Graphics, e.DisplayText, e.TextRectangle, e.Style); } } This is explanation for ForceDrawText that we will add: /// Specifies if GDI DrawText routine should always be used and text should be clipped. When you /// set this true the performance of the GDI drawing routine will be the same as for GDIplus DrawString /// since text needs to be clipped everytime it is drawn. If you want to force GDI DrawText on a cell /// by cell basis you can specify style.Trimming = System.Drawing.StringTrimming.Character instead /// and leave ForceDrawText = false. public static bool ForceDrawText = false; Stefan

Administrator [Syncfusion]
Replied On September 30, 2004 08:22 AM

Thanks for the response. Currently, I am not setting e.Style.Trimming so next version this should work since the default for this setting is StringTrimming.Character. Is this something I could open a direct trac incident to get a private build? Thanks, Steve

Administrator [Syncfusion]
Replied On September 30, 2004 01:04 PM

I checked in those changes. So, yes you can submit a incident and support will send you a private patch when it is available. Good you mentioned that the default is StringTrimming.Character. I might need to change that again then slighlty or point that out to programmers who have high update scenarios so they are aware of it ... I will mention that in the GridGDIPaint docs in case I make changes again. Stefan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;