summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-01-04 08:23:47 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-01-04 08:26:30 +0200
commit784ca2d73117c044cfb20ce75e51c4269c9cbfa8 (patch)
tree5dd3a0d75875eedb8221b16423562bdd38e1e43a /src/gmdocument.c
parent60776cc0385dd0cddeb2faa6d78e094cfa45bb73 (diff)
Text: Light and regular font weight via ANSI escapes
SGR codes 2 and 10.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index fd13bc82..60773e0b 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -556,16 +556,22 @@ static const int maxLedeLines_ = 10;
556 556
557static void applyAttributes_RunTypesetter_(iRunTypesetter *d, iTextAttrib attrib) { 557static void applyAttributes_RunTypesetter_(iRunTypesetter *d, iTextAttrib attrib) {
558 /* WARNING: This is duplicated in run_Font_(). Make sure they behave identically. */ 558 /* WARNING: This is duplicated in run_Font_(). Make sure they behave identically. */
559 if (attrib.bold) { 559 if (attrib.monospace) {
560 d->run.font = fontWithStyle_Text(d->baseFont, bold_FontStyle); 560 d->run.font = fontWithFamily_Text(d->baseFont, monospace_FontId);
561 d->run.color = tmFirstParagraph_ColorId; 561 d->run.color = tmPreformatted_ColorId;
562 } 562 }
563 else if (attrib.italic) { 563 else if (attrib.italic) {
564 d->run.font = fontWithStyle_Text(d->baseFont, italic_FontStyle); 564 d->run.font = fontWithStyle_Text(d->baseFont, italic_FontStyle);
565 } 565 }
566 else if (attrib.monospace) { 566 else if (attrib.regular) {
567 d->run.font = fontWithFamily_Text(d->baseFont, monospace_FontId); 567 d->run.font = fontWithStyle_Text(d->baseFont, regular_FontStyle);
568 d->run.color = tmPreformatted_ColorId; 568 }
569 else if (attrib.bold) {
570 d->run.font = fontWithStyle_Text(d->baseFont, bold_FontStyle);
571 d->run.color = tmFirstParagraph_ColorId;
572 }
573 else if (attrib.light) {
574 d->run.font = fontWithStyle_Text(d->baseFont, light_FontStyle);
569 } 575 }
570 else { 576 else {
571 d->run.font = d->baseFont; 577 d->run.font = d->baseFont;