-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update(lists): add symbol font size option #196
base: master
Are you sure you want to change the base?
Conversation
Would you be able to add some tests around it? Checking that expectations meets reality? |
I'll take a look on the test code. |
Seems like the initial
// Heading1ai
{
int listFontSize = 32;
var wordList2 = doc.AddList(WordListStyle.Heading1ai, false, listFontSize);
foreach (var point in data.ListContent)
{
wordList2.AddItem($"{point}", 0)
.SetFontSize(listFontSize);
}
}
{
// font size on numbering symbol not applied
int listFontSize = 10;
var wordList2 = doc.AddList(WordListStyle.Heading1ai, false, listFontSize);
foreach (var point in data.ListContent)
{
wordList2.AddItem($"{point}", 0)
.SetFontSize(listFontSize);
}
}
// Bulleted
{
int listFontSize = 10;
var wordList2 = doc.AddList(WordListStyle.Bulleted, false, listFontSize);
foreach (var point in data.ListContent)
{
wordList2.AddItem($"{point}", 0)
.SetFontSize(listFontSize);
}
}
{
// font size on numbering symbol not applied
int listFontSize = 24;
var wordList2 = doc.AddList(WordListStyle.Bulleted, false, listFontSize);
foreach (var point in data.ListContent)
{
wordList2.AddItem($"{point}", 0)
.SetFontSize(listFontSize);
}
} |
After merging with master internal static void Example_BasicLists8(string folderPath, bool openWord) {
Console.WriteLine("[*] Creating standard document with lists - Document 8");
string filePath = System.IO.Path.Combine(folderPath, "Document with Lists11.docx");
using (WordDocument document = WordDocument.Create(filePath)) {
// add list and nest a list
WordList wordList1 = document.AddList(WordListStyle.Headings111, false, 15);
wordList1.AddItem("Text 1");
wordList1.AddItem("Text 1.1");
wordList1.AddItem("Text 1.2");
wordList1.AddItem("Text 1.3");
document.AddParagraph("Second List");
document.AddParagraph();
WordList wordList2 = document.AddList(WordListStyle.Headings111, false, 25);
wordList2.AddItem("Text 2");
wordList2.AddItem("Text 2.1");
wordList2.AddItem("Text 2.2");
wordList2.AddItem("Text 2.3");
wordList2.AddItem("Text 2.4");
document.AddParagraph("Third List");
document.AddParagraph();
WordList wordList3 = document.AddList(WordListStyle.Headings111, false, 50);
wordList3.AddItem("Text 3");
wordList3.AddItem("Text 3.1");
wordList3.AddItem("Text 3.2");
wordList3.AddItem("Text 3.3");
wordList3.AddItem("Text 3.4");
document.Save(openWord);
}
} You're now ready to continue ;) |
Althought it still would be valid what's the difference between using it how you are using and how Word uses Paragraph Properties for that. |
awesome, thanks! |
Issue: Currently there's no way to set font size of the list's numbering/bullet symbol.
This PR adds the option to set the font size for numbering symbols in
AddList()
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.