GDI+ and font sizes

Discussion in 'ASP .Net' started by Jeff, Jun 30, 2009.

  1. Jeff

    Jeff Guest

    Hi

    asp.net 3.5

    I'm playing arround with GDI+ and DrawString.

    One thing that I feel is strange is how small the fontsizes are.
    I'm using ths font:
    Font drawFont = new Font("Verdana", 4);

    When when displayed on the image shows like a fontsize 10...

    Why are the fontsize so small?, why cannot I just set it to 10? (If I set it
    to 10 now the text will be to large)

    any ideas?



    -----------------------------------------------------------------------------
    Less Spam Better enjoyable experience
    Visit : news://spacesst.com
     
    Jeff, Jun 30, 2009
    #1
    1. Advertising

  2. On Jun 30, 10:06 am, "Jeff" <> wrote:
    > Hi
    >
    > asp.net 3.5
    >
    > I'm playing arround with GDI+ and DrawString.
    >
    > One thing that I feel is strange is how small the fontsizes are.
    > I'm using ths font:
    > Font drawFont = new Font("Verdana", 4);
    >
    > When when displayed on the image shows like a fontsize 10...
    >
    > Why are the fontsize so small?, why cannot I just set it to 10? (If I set it
    > to 10 now the text will be to large)
    >
    > any ideas?
    >
    > --------------------------------------------------------------------------- --
    > Less Spam Better enjoyable experience
    > Visit : news://spacesst.com


    The font size used "points", but not pixels.
    http://msdn.microsoft.com/en-us/library/164w6x6z.aspx

    The Font class has another constructor where you may specify units
    try to call

    Font drawFont = new Font("Verdana", 10, GraphicsUnit.Pixels);

    to see if it helps

    More at: http://msdn.microsoft.com/en-us/library/ms141986.aspx
     
    Alexey Smirnov, Jun 30, 2009
    #2
    1. Advertising

  3. Jeff

    Patrice Guest

    The unit is not what you expect ?

    See : http://msdn.microsoft.com/en-us/library/ms141986.aspx that allwso to
    explictely tell which unit you want...

    --
    Patrice

    "Jeff" <> a écrit dans le message de groupe
    de discussion : #TZ69mV#...
    > Hi
    >
    > asp.net 3.5
    >
    > I'm playing arround with GDI+ and DrawString.
    >
    > One thing that I feel is strange is how small the fontsizes are.
    > I'm using ths font:
    > Font drawFont = new Font("Verdana", 4);
    >
    > When when displayed on the image shows like a fontsize 10...
    >
    > Why are the fontsize so small?, why cannot I just set it to 10? (If I set
    > it to 10 now the text will be to large)
    >
    > any ideas?
    >
     
    Patrice, Jun 30, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robin van de Water [synthesiSFactory]

    GDI+ is not properly initialized (internal GDI+ error).

    Robin van de Water [synthesiSFactory], Jan 10, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    1,383
    Robin van de Water [synthesiSFactory]
    Jan 10, 2007
  2. Replies:
    5
    Views:
    950
  3. jodleren

    <td> and font sizes...

    jodleren, Oct 24, 2007, in forum: HTML
    Replies:
    34
    Views:
    1,160
    dorayme
    Oct 26, 2007
  4. mttc
    Replies:
    2
    Views:
    2,450
    Roedy Green
    Jul 3, 2009
  5. Anton

    GDI+ Font Size problem

    Anton, Aug 11, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    464
    Anton
    Aug 11, 2009
Loading...

Share This Page