Character calculation

The GenerateParagraph fucnction generates the character rectangles and the line lists of a paragraph every time characters are added or removed or when the font or alignment is changed. First, we generate lists of sizes and ascents for every character as well as the line list by calling the GenerateSizeAndAscentList and GenerateLineList methods. Then, we iterate through the line list and generate the character rectangles by calling the GenerateLineRectList method. Finally, we invalidate the characters that have been changed by comparing them to the original rectangle lists:

void WordDocument::GenerateParagraph(Paragraph* paragraphPtr) { if (!charList.Empty()) { DynamicList<Size> sizeList; DynamicList<int> ascentList; DynamicList<CharInfo> ...

Get C++ Windows Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.