SyntaxEditor font size and line height problem

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Mauro - Italy
Version: 13.1.0310
Avatar

Hi,

I have a TextBox and a SyntaxEditor on a form.

I set the same font using the following code:

 

syntaxEditor1.MinimumDisplayLineHeight = 0;

var f1 = newFont(aFontName, aFontSize);

var f2 = newFont(aFontName, aFontSize);

textBox1.Font = f1;

syntaxEditor1.Font = syntaxEditor1.LineNumberMarginFont = syntaxEditor1.UserMarginFont = f2;

 

I'd like the two controls have exactly the same appearance. Is it possible?

Now line height in syntaxeditor is greater or less than textbox line height depending by font name/size.

Could yuo help me, please? Thank you.

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, what font family and size are you using so that we can take a look?


Actipro Software Support

Posted 11 years ago by Mauro - Italy
Avatar

I'd like to have the same appearance using all fonts, but you can try Verdana 10pt, Times New Roman 10pt, Microsoft Sans Serif 10pt, ...

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mauro,

I debugged this and the problem appears to be that the Font height passed to us by .NET is larger than the line height that a native TextBox ends up rendering at with the same font.  Since our code uses that font height as a minimum, we can't really work around this issue.  Sorry... perhaps you could use a monospace font in the SyntaxEditor version so the difference isn't as apparent.


Actipro Software Support

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.