Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Description: SynPdfTest
Submitted on February 1, 2021 at 08:41 PM

New Paste 1 (Delphi)

// Chinese Font bold style does not work, when EmbeddedTTF is true (Page 1) / PDF Engine / mORMot Open Source
// https://synopse.info/forum/viewtopic.php?pid=34260
var
  lPdf: TPdfDocumentGDI;
begin
  lPdf := TPdfDocumentGDI.Create;
  try
    lPdf.ScreenLogPixels := 96;
    lPdf.DefaultPaperSize := psA4;
    lPDF.EmbeddedTTF := True;
    lPDF.AddPage;
    //
    lPdf.VCLCanvas.Brush.Style := bsClear;
    lPdf.VCLCanvas.Font.Size := 32;
    //
    lPdf.VCLCanvas.Font.Name := 'Tahoma';
    lPdf.VCLCanvas.Font.Style := [fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 60, 'Tahoma [fsItalic, fsUnderline, fsStrikeOut]');
    lPdf.VCLCanvas.Font.Style := [fsBold, fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 120, 'Tahoma [fsBold, fsItalic, fsUnderline, fsStrikeOut]');
    //
    lPdf.VCLCanvas.Font.Name := 'Arial';
    lPdf.VCLCanvas.Font.Style := [fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 180, 'Arial [fsItalic, fsUnderline, fsStrikeOut]');
    lPdf.VCLCanvas.Font.Style := [fsBold, fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 240, 'Arial [fsBold, fsItalic, fsUnderline, fsStrikeOut]');
    //
    lPdf.VCLCanvas.Font.Name := 'Arial Unicode MS';
    lPdf.VCLCanvas.Font.Style := [fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 300, 'Arial Unicode MS [fsItalic, fsUnderline, fsStrikeOut]');
    lPdf.VCLCanvas.Font.Style := [fsBold, fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 360, 'Arial Unicode MS [fsBold, fsItalic, fsUnderline, fsStrikeOut]');
    //
    lPdf.VCLCanvas.Font.Name := 'MingLiU';
    lPdf.VCLCanvas.Font.Style := [fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 420, 'MingLiU [fsItalic, fsUnderline, fsStrikeOut]');
    lPdf.VCLCanvas.Font.Style := [fsBold, fsItalic, fsUnderline, fsStrikeOut];
    lPdf.VCLCanvas.TextOut(20, 480, 'MingLiU [fsBold, fsItalic, fsUnderline, fsStrikeOut]');
    //
    lPdf.SaveToFile('SynPdfTest.pdf');
  finally
    lPdf.Free;
  end;
end;