draw.GetFontHeight
From GMod Wiki
| Function | |
| Syntax |
draw.GetFontHeight( String Font ) Where is this used? |
| Description: | |
| Gets the height of Font | |
| Returns: | Number |
| Part of Library: | Draw |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Draw.GetFontHeight]Draw.GetFontHeight [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Returns the font height for the scoreboard font. |
|---|---|
| Used on | |
| Code | height = draw.GetFontHeight("ScoreboardText") |
| Output | Height of ScoreBoard font. |
Additional Notes
- In actuality, this function calculates the font height as being the height of capital W in that font. As such, it assumes that capital W is actually the tallest character.
- This function would be useful for calculating the height that a label should be in order to display all text. It could also be used to determine line spacing for multi-line text.