none
Why the font size (Calibri 11F) changed in another computer? RRS feed

  • Question

  • I have set the font size of Calibri Style through my code in 11F.

    ((Label)c).Font= new System.Drawing.Font("Calibri", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

    It's normal in the program computer. 

    But when i release the application and install it in another computer. the size of font is changed into 12F.

    Why? And how to keep it in 11F. I prefer 11F!

    I have checked the font settings of Windows 8 and found and opened the Calibri font file. There are only sizes of 12, 18, 24, 36, 48, 60, 72.

    Is this the reason of change from 11 to 12?

    Thanks.




    • Edited by Lannykid Monday, September 22, 2014 6:42 AM add a screen shot.
    Friday, September 19, 2014 3:51 AM

Answers

All replies

  • try to alter your code

    ((Label)c).Font= new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

    by

    ((Label)c).Font= new System.Drawing.Font("Calibri", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

    Hope above help.

    Friday, September 19, 2014 4:57 AM
  • try to alter your code

    ((Label)c).Font= new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

    by

    ((Label)c).Font= new System.Drawing.Font("Calibri", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

    Hope above help.

    Sorry the code is 11F. Not 12F.

    So this is not the key.


    Friday, September 19, 2014 5:50 AM
  • What is an extention of your Windows 8 ? For Windows 8 Pro and Office 13 the default font size of Calibri is 11F and the range is from 6F.
    Friday, September 19, 2014 7:05 AM
  • What is an extention of your Windows 8 ? For Windows 8 Pro and Office 13 the default font size of Calibri is 11F and the range is from 6F.

     WIN8.1

    The font size should be anything with float type. so 11 or 12 should not be the problem.

    but the problem is i set the size with 11f but 12f in another computer.

    is the setting will fail in the other computer?

    Friday, September 19, 2014 7:08 AM
  • if WIN8.1 in another computer, the font size has to be 11F by default.

    Can you show me your code more and another computer settings ?

    • Edited by Doanh, Qh Friday, September 19, 2014 8:09 AM more information
    Friday, September 19, 2014 8:06 AM
  • if WIN8.1 in another computer, the font size has to be 11F by default.

    Can you show me your code more and another computer settings ?

    Here is a function to change the font of a panel into 11F Calibri.

    Anything wrong?

            public static void SetLabelStyle(Panel panel)
            {
                foreach (Control c in panel.Controls)
                {
                    if (c.GetType() == typeof(Label))
                    {
                        ((Label)c).ForeColor = Color.Black ;
                        ((Label)c).Font= new System.Drawing.Font("Calibri", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                        ((Label)c).BackColor = Color.FromArgb(255, 255, 204);
                    }
                }
            }

    Monday, September 22, 2014 6:10 AM
  • if you change the project properties (for example, by changing method parameters) the font size can be changed.
    Monday, September 22, 2014 8:10 AM