2016-10-19 4 views
0

私は2つの列と複数の行を持つテーブルを持っているので、最初の列を太字にする必要があります。私はcolumn.Format.Font.Bold = true;を使ってみましたが、フォントを太字に変更しません。 column.Format.Font.Colors = Colors.Blue;を使用しても機能しますが、太字のスタイルは機能しません。誰かが私が間違っていることを助言してもらえますか?これは、テーブルを作成するコード断片である:C#/ MigraDoc - 太字のテーブルの列

 Table topTable = pdfReport.LastSection.AddTable(); 
     topTable.Borders.Visible = true; 
     topTable.Borders.Color = Colors.Gray; 
     topTable.Format.Font.Name = "Calibri Light"; 
     topTable.Format.Font.Size = 8; 
     topTable.Format.Font.Color = Colors.Black; 
     topTable.Format.SpaceAfter = 0; 
     topTable.Format.SpaceBefore = 0; 
     Column column; 
     column = topTable.AddColumn(90); 
     column.Format.Font.Bold = true;  // <-- this 
     column = topTable.AddColumn(400); 
     Row row; 
     row = topTable.AddRow(); 
     row.Cells[0].AddParagraph("Analysis Run:"); 
     row.Cells[1].AddParagraph(_report.AnalysisRun.ToString()); 
     row = topTable.AddRow(); 
     row.Cells[0].AddParagraph("Case Number:"); 
     row.Cells[1].AddParagraph(_report.CaseNumber); 
     row = topTable.AddRow(); 
     row.Cells[0].AddParagraph("Sample ID:"); 
     row.Cells[1].AddParagraph(_report.SampleID); 
     row = topTable.AddRow(); 
     row.Cells[0].AddParagraph("Comments:"); 
     row.Cells[1].AddParagraph(_report.Comments); 
+0

バージョン1.50ベータ版3bを使用していますか?それとも古いバージョンですか?どのビルドを使用していますか(GDI +またはWPF)? –

答えて

1

ただの推測:私はこの問題は、フォント「Calibri軽い」だと思います。 「Calibri Light」の大胆なバージョンはありません.MigraDocは、「Calibri Light Bold」が必要な場合は「Calibri Regular」を使用する必要があります。

フォント名を「Calibri」または「Arial」、またはレギュラーとボールドの両方をサポートする他のフォントに変更すると、MigraDocがこれを正しく処理できることを願っています。

最初の列に「Calibri」というフォント名を設定すると、そのトリックを行う必要があります。

+0

あなたは正しいです。私はフォントをTahomaに変更しました。うまくいきました。ありがとうございました。 – user2430797

関連する問題