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. Graphics
  4. How to make a font height equal to "tmHeight"?

How to make a font height equal to "tmHeight"?

Scheduled Pinned Locked Moved Graphics
tutorialcssquestion
7 Posts 4 Posters 2 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.
  • T Offline
    T Offline
    transoft
    wrote on last edited by
    #1

    Hi, When I printed a text on screen, I saw the text height equal to "tmHeight- tmInternalLeading". For example: I printed a text size "8" on screen, I got the actual text height "tmHeight - tmInternalLeading" which is less than "8". I printed a letter of "H" which height is less than "8", when I used "Arial" true type font of size "8". Is there a way to make a actual text height (on screen) (ascent) equal to "8"? Best,

    L 1 Reply Last reply
    0
    • T transoft

      Hi, When I printed a text on screen, I saw the text height equal to "tmHeight- tmInternalLeading". For example: I printed a text size "8" on screen, I got the actual text height "tmHeight - tmInternalLeading" which is less than "8". I printed a letter of "H" which height is less than "8", when I used "Arial" true type font of size "8". Is there a way to make a actual text height (on screen) (ascent) equal to "8"? Best,

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      8 points, 8 pixel, 8em? And where?

      transoft wrote:

      Is there a way to make a actual text height (on screen) (ascent) equal to "8"?

      Yes, by setting the font-size. Do keep in mind that different characters have different heights', unless you're using a monospace font like courier.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      T U 2 Replies Last reply
      0
      • L Lost User

        8 points, 8 pixel, 8em? And where?

        transoft wrote:

        Is there a way to make a actual text height (on screen) (ascent) equal to "8"?

        Yes, by setting the font-size. Do keep in mind that different characters have different heights', unless you're using a monospace font like courier.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        T Offline
        T Offline
        transoft
        wrote on last edited by
        #3

        Thanks for reply. Maybe I did not make clear. I set font size to be 8 unit which should be printed on screen to be (suppose) 100. But I got 90 (letter height) which equals to ascent. It looks like font size is defined to be equal to "ascent + InternalLeading". My question is: Is there a way to let (letter height) to be "ascent + InternalLeading".

        L 1 Reply Last reply
        0
        • T transoft

          Thanks for reply. Maybe I did not make clear. I set font size to be 8 unit which should be printed on screen to be (suppose) 100. But I got 90 (letter height) which equals to ascent. It looks like font size is defined to be equal to "ascent + InternalLeading". My question is: Is there a way to let (letter height) to be "ascent + InternalLeading".

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          transoft wrote:

          Maybe I did not make clear.

          True. Which "unit"? A pixel can be a unit, a centimeter can be one. Printed on screen? On a form as a label? Drawed as a bitmap?

          transoft wrote:

          It looks like font size is defined to be equal to "ascent + InternalLeading".

          Where did you get that information? The font size is usually set by specifying the size property, as shown here[^]. Can you post some code that explains what you're doing?

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          J 1 Reply Last reply
          0
          • L Lost User

            8 points, 8 pixel, 8em? And where?

            transoft wrote:

            Is there a way to make a actual text height (on screen) (ascent) equal to "8"?

            Yes, by setting the font-size. Do keep in mind that different characters have different heights', unless you're using a monospace font like courier.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            U Offline
            U Offline
            User 10871436
            wrote on last edited by
            #5

            visit this [url=http://www.jbbuilders.org.uk/jb/\]roofers in london[/url]

            U 1 Reply Last reply
            0
            • U User 10871436

              visit this [url=http://www.jbbuilders.org.uk/jb/\]roofers in london[/url]

              U Offline
              U Offline
              User 10871436
              wrote on last edited by
              #6

              roofers in london

              1 Reply Last reply
              0
              • L Lost User

                transoft wrote:

                Maybe I did not make clear.

                True. Which "unit"? A pixel can be a unit, a centimeter can be one. Printed on screen? On a form as a label? Drawed as a bitmap?

                transoft wrote:

                It looks like font size is defined to be equal to "ascent + InternalLeading".

                Where did you get that information? The font size is usually set by specifying the size property, as shown here[^]. Can you post some code that explains what you're doing?

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                J Offline
                J Offline
                jinzai
                wrote on last edited by
                #7

                The information -- is correct. There is internal leading (rhymes with sledding) and external leading. They are there to pad the character within its space and to provide space between lines for things like ascenders and descenders, which exceed the character's space.

                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