TextBox scaling with Microsoft Sans Serif font

5 posts, 1 answers
  1. Frank Beerens
    Frank Beerens avatar
    26 posts
    Member since:
    Jan 2010

    Posted 14 Apr 2014 Link to this post

    Hi,

    When I use a telerik textbox, and set the font to Microsoft Sans Serif (size 11,25 pt) (see A in the attachment), some characters are not displayed fully. When I use Segoe UI it is rendered correctly (B in the attachment). Looks like the scaling of the component does not work 100%. Setting autosize to false does not work either: I am able to scale the control, but the 'inner textbox' stays too small.

    Best Regards
  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 16 Apr 2014 Link to this post

    Hello Frank,

    Thank you for writing.

    Your question has already been answered in the other thread you have opened. Please, see our answer there for more information.

    Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Frank Beerens
    Frank Beerens avatar
    26 posts
    Member since:
    Jan 2010

    Posted 16 Apr 2014 in reply to Dess Link to this post

    Hello Desislava,

    There is no relation between my two posts. This has noting to do with DPI scaling or whatsoever.

    To reproduce this problem:
    Create a winforms project, put two radtextboxes on a form, and set the font of one of them to Microsoft Sans Serif (size 11,25 pt).
    When you type a character like 'g', the lower curve of the character is not painted correctly.

    Regards
  5. Frank Beerens
    Frank Beerens avatar
    26 posts
    Member since:
    Jan 2010

    Posted 17 Apr 2014 in reply to Frank Beerens Link to this post

    It also happens when using a combobox. The lower parts of the characters dissapear when using Microsoft Sans Serif 11.25 pt.

    Regards
  6. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 18 Apr 2014 Link to this post

    Hello Frank,

    Following up on this case, it appears that this is a known issue which we already have in our feedback portal: http://feedback.telerik.com/Project/154/Feedback/Details/110711-fix-radtextbox-text-is-cut-from-below

    As you can see in the description, the workaround is to set a MinimumSize to the inner text box. You can also see how to use TextMeasurer to measure the height of the text so that the text box sizes correctly with all fonts.
    this.radTextBox1.TextBoxElement.TextBoxItem.HostedControl.MinimumSize = new Size(0, 20);
    this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.HostedControl.MinimumSize = new Size(0, 20);

    I hope you find this useful. Should you have any other questions, do not hesitate to write back.

    Regards,
    Ivan Todorov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready