1. Home
  2. Computing & Technology
  3. Delphi Programming

Get the Height/Width of a Character (for OwnerDrawing and printing)

By Zarko Gajic, About.com

When using OwnerDrawing or Printing it is good to know the (max) Height and Width of character for a given Canvas - in pixels. The SomeComponents represents a component with a Canvas (the one derived from TWinControl)

~~~~~~~~~~~~~~~~~~~~~~~~~
SomeComponent.Canvas.TextWidth('H') ;
SomeComponent.Canvas.TextHeight('I') ;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» List Devices (LPT, COM ports, ...)
« Change glyphs of TDBNavigator Buttons

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2001 Delphi Tips
  7. Get the Height/Width of a Character (for OwnerDrawing and printing)

©2009 About.com, a part of The New York Times Company.

All rights reserved.