summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-02 07:08:35 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-02 07:08:35 +0300
commita346dd6450b9c6636110d1c882d28ca4dc82573d (patch)
tree3d3b6156ae45b858b3c4bee70d80283344fc872b /src/gmdocument.c
parent6d297b8ec945a62d66c530b0b9b19202e1b18cff (diff)
GmDocument: First paragraph styling
Only show a limited number of rows of larger text.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 116e532a..9fd56fce 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -412,9 +412,11 @@ static void doLayout_GmDocument_(iGmDocument *d) {
412 run.color = colors[text_GmLineType]; 412 run.color = colors[text_GmLineType];
413 } 413 }
414 /* Special formatting for the first paragraph (e.g., subtitle, introduction, or lede). */ 414 /* Special formatting for the first paragraph (e.g., subtitle, introduction, or lede). */
415 int bigCount = 0;
415 if (type == text_GmLineType && isFirstText) { 416 if (type == text_GmLineType && isFirstText) {
416 run.font = firstParagraph_FontId; 417 run.font = firstParagraph_FontId;
417 run.color = gray88_ColorId; 418 run.color = gray88_ColorId;
419 bigCount = 6; /* lines */
418 isFirstText = iFalse; 420 isFirstText = iFalse;
419 } 421 }
420 else if (type != header1_GmLineType) { 422 else if (type != header1_GmLineType) {
@@ -452,6 +454,10 @@ static void doLayout_GmDocument_(iGmDocument *d) {
452 runLine.start = contPos; 454 runLine.start = contPos;
453 trimStart_Rangecc(&runLine); 455 trimStart_Rangecc(&runLine);
454 pos.y += lineHeight_Text(run.font); 456 pos.y += lineHeight_Text(run.font);
457 if (--bigCount == 0) {
458 run.font = paragraph_FontId;
459 run.color = colors[text_GmLineType];
460 }
455 } 461 }
456 /* Flag the end of line, too. */ 462 /* Flag the end of line, too. */
457 ((iGmRun *) back_Array(&d->layout))->flags |= endOfLine_GmRunFlag; 463 ((iGmRun *) back_Array(&d->layout))->flags |= endOfLine_GmRunFlag;