常见问题 TBarCode DLL / TBarCode Library
在 Delphi 中更改条码字体样式
在 Delphi 中更改条码字体样式
创建一个 LOGFONT 结构,并使用 BCSetLogFont 函数进行设置。
Function BCSetLogFont ( const pBarCode:t_BarCode; // IN : Ptr To Barcode-Definition lf:LOGFONT // IN : TLogFont (TFont) structure ):TErrCode; external 'TBarCode8.dll';
以下是一个 LOGFONT 结构的示例。要调整字号,需要更改结构中的参数 lfHeight。
var
lf:TLogFont;
begin
lf.lfHeight := 24; {char height in pixels }
lf.lfWidth := 12; {char width in pixels }
lf.lfEscapement := 0; {orientation of next char }
lf.lfOrientation := 0; {orientation of first char}
lf.lfWeight := FW_NORMAL; {normal thickness }
lf.lfItalic := 0; {not italic characters }
lf.lfUnderline := 0; {not underlined characters}
lf.lfStrikeOut := 0; {not strikeout characters }
lf.lfCharSet := OEM_CHARSET;{OEM character set }
lf.lfOutPrecision := 0; {default output precision }
lf.lfClipPrecision := 0; {default clipping precision}
lf.lfQuality := DEFAULT_QUALITY; {default scaling quality}
lf.lfPitchAndFamily := FF_SCRIPT;{default pitch,
script font family }
lstrcpy(lf.lfFaceName,'Arial'+chr(0)); {script typeface}
有关 LOGFONT 的更多信息,请访问 http://msdn.microsoft.com/en-us/library/ms533931(VS.85).aspx