Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to determine the real font size?

How to determine the real font size?

Scheduled Pinned Locked Moved C#
csharpvisual-studiographicstutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Frank Horn
    wrote on last edited by
    #1

    When you change the font size for a control in Visual Studio, you can often see that VS seems to know better; e.g. you select Arial 10, and when you look at the property window afterwards, it has changed to 10.2. My experience with a little proportional resizing tool I wrote in C# seems to imply that this happens at runtime as well, which causes problems when labels are to close to each other (they may overlap when I have computed their positions based on font size 10 but really they autosize to 10.2). Does anybody know how I can determine at runtime with which font size a text is actually being rendered? And what the reason for all this is anyway? Graphics isn't exactly my strong point, and I'm running out of ideas for search criteria to find something related.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups