I am creating a new table in aspose.slides for .net. I am trying to figure out if there is a way to set the fontsize for the whole table to avoid having to set fontheight for every specfic cell (as in this example)
Is it possible to just set fontheight once and have it apply to all cells in a table in aspose.slides?
I have observed the requirements shared by you and like to share that the text height (font size) is set on portion levels of paragraphs inside a cell text frame. This is in fact not a missing feature but a regular implementation of text as it should have to be. I have written a method for you that serve the purpose in this regard.
public static Table SetDefFont(Table tab, int iFontHeight) { ITextFrame text = null; for (int i = 0; i < tab.Columns.Count; i++) { for (int j = 0; j < tab.Rows.Count; j++) { text = tab[i, j].TextFrame; if (text != null) { if (text.Text != String.Empty) { for (int k = 0; k < text.Paragraphs.Count; k++) { IParagraph para=text.Paragraphs[k]; for (int l = 0; l < para.Portions.Count; l++) { IPortion port = para.Portions[l]; port.PortionFormat.FontHeight = iFontHeight; } } } } } } return tab; }
Please share, if I may help you further in this regard.