可以,象下面这样,必须先声明一下:
unit UN_TDprint;
interface
uses
Printers,Windows, Messages, SysUtils, Variants, Classes, Graphics, Dialogs, Controls,forms;
//取得字符的高度
function CharHeight: Word;
implementation
//取得字符的高度
function CharHeight: Word;
var
Metrics: TTextMetric;
begin
GetTextMetrics(Printer.Canvas.Handle, Metrics);
Result := Metrics.tmHeight;
end;
end.