function GetNumberBuffer(cZi: string; cwidth, cheight: Integer; FontName: string; bold, italic: Boolean): TDataBytes;
var
col, row: Integer;
cw, ch, cleft, ctop: Integer;
style: TFontStyle;
begin
with TBitmap.Create do
try
SetSize(cwidth, cheight);
PixelFormat := pf32bit;
cw := Canvas.TextWidth(cZi);
ch := Canvas.TextHeight('01234567890.');
cleft := (cwidth - cw) div 2;
ctop := (cheight - ch) div 2;
if bold then Canvas.Font.Style := Canvas.Font.Style + [fsBold];
if italic then Canvas.Font.Style := Canvas.Font.Style + [fsItalic];
Canvas.TextOut(cleft, ctop, cZi);
SetLength(Result, Width, Height);
for col := 0 to Width - 1 do
for row := 0 to Height - 1 do
if Canvas.Pixels[col, row] = 0 then
Result[col, row] := 1
else Result[col, row] := 0;
finally
Free;
end;
end;