// 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;