Using IDE font


#1

We are using a framework similar in appearance to the Visual Studio .NET IDE in which to display a Go diagram. The font used by the Go objects looks out of place next to the IDE font, which I believe to be a 7.5 or 8pt “small fonts” face. We’d like to try setting the font to SystemInformation.MenuFont; however the Font property of the GoText objects seems to be read only. How can we accomplish the font change?


#2

You’ll need to set the individual properties. I haven’t tested this, but something like:
t.FamilyName = f.Name;
t.FontSize = f.Size;
t.Bold = f.Bold;
t.Italic = f.Italic;
t.Underline = f.Underline;
t.StrikeThrough = f.Strikeout;
t.GdiCharSet = f.GdiCharSet;


#3

Thank you for the reply, much appreciated. We have not however been able to change the text drawn by Go to assume the appearance of system menus etc. As this is very important to us, we have invested some effort into trying various options. After having little success, we finally enlarged a screen shot and see from the result that Go renders the text as anti-aliased, which of course causes the fatter appearance and the kerning problems at smaller point sizes that we have experienced. Although perhaps seemingly minor, the consistency of the UI appearance is a big issue for us. How can we specify to Go that that particular rendering hint should not be applied?


#4

You can set GoView.TextRenderingHint.
If you want to have “mixed” renderings of text, you can override GoText.Paint to temporarily set the Graphics.TextRenderingHint to what you want during the call to the base method.


#5

That does it thanks!


#6

By the way, we’ll probably make the Font property settable in the future.