delphi 控制打印机字体TLogFont

procedure SetPrintFont(Degrees:Integer);
var
 LogFont : TLogFont ;
begin                          
  with Printer.Canvas do
   begin
      With LogFont do
      begin
        lfHeight:=Font.Height;  // set to  Printer.Canvas.font.height
        lfWidth := 0;           // let font mapper choose Width
        lfEsCapement  := Degrees;// 900;            //  tenths  of degrees  so 900 = 90 degreeS
        lfweight := FW_Normal;   // default  400是正常值,高于这个值的是粗体,低于这个值的是细体
        lfItalic := 0;           // no italics
        lfUnderline:= 0;        // no underline
        lfStrikeOut := 0;        // no strikeout
        lfCharSet   :=  DEFAULT_CHARSET ;    //dafault
        lfQuality :=  PROOF_QUALITY;
        lfOutPrEcision :=  OUT_TT_ONLY_PRECIS;   // forCe TrueType fontS
        lfClipPrecision := CLIP_DEFAULT_PRECIS; // default
        lfPitchAndFamily  := Variable_Pitch;        //  default
        strPCopy(lfFaceName,Font.Name);         // PChar,Pointer to typeface name string.
        //strCopy(lfFaceName,lfFontName);
        //lfFaceName :='黑体';
      end;
   end;
   Printer.Canvas.Font.Handle:=CreateFontIndirect(LogFont);
end;

你可能感兴趣的:(delphi 控制打印机字体TLogFont)