=> 784ca2d73117c044cfb20ce75e51c4269c9cbfa8
[1mdiff --git a/src/gmdocument.c b/src/gmdocument.c[m [1mindex fd13bc82..60773e0b 100644[m [1m--- a/src/gmdocument.c[m [1m+++ b/src/gmdocument.c[m [36m@@ -556,16 +556,22 @@[m [mstatic const int maxLedeLines_ = 10;[m [m static void applyAttributes_RunTypesetter_(iRunTypesetter *d, iTextAttrib attrib) {[m /* WARNING: This is duplicated in run_Font_(). Make sure they behave identically. */[m [31m- if (attrib.bold) {[m [31m- d->run.font = fontWithStyle_Text(d->baseFont, bold_FontStyle);[m [31m- d->run.color = tmFirstParagraph_ColorId;[m [32m+[m[32m if (attrib.monospace) {[m [32m+[m[32m d->run.font = fontWithFamily_Text(d->baseFont, monospace_FontId);[m [32m+[m[32m d->run.color = tmPreformatted_ColorId;[m }[m else if (attrib.italic) {[m d->run.font = fontWithStyle_Text(d->baseFont, italic_FontStyle);[m }[m [31m- else if (attrib.monospace) {[m [31m- d->run.font = fontWithFamily_Text(d->baseFont, monospace_FontId);[m [31m- d->run.color = tmPreformatted_ColorId;[m [32m+[m[32m else if (attrib.regular) {[m [32m+[m[32m d->run.font = fontWithStyle_Text(d->baseFont, regular_FontStyle);[m [32m+[m[32m }[m [32m+[m[32m else if (attrib.bold) {[m [32m+[m[32m d->run.font = fontWithStyle_Text(d->baseFont, bold_FontStyle);[m [32m+[m[32m d->run.color = tmFirstParagraph_ColorId;[m [32m+[m[32m }[m [32m+[m[32m else if (attrib.light) {[m [32m+[m[32m d->run.font = fontWithStyle_Text(d->baseFont, light_FontStyle);[m }[m else {[m d->run.font = d->baseFont;[m [1mdiff --git a/src/ui/text.c b/src/ui/text.c[m [1mindex 116c5eba..4b43f872 100644[m [1m--- a/src/ui/text.c[m [1m+++ b/src/ui/text.c[m [36m@@ -453,6 +453,10 @@[m [mvoid setAnsiFlags_Text(int ansiFlags) {[m activeText_->ansiFlags = ansiFlags;[m }[m [m [32m+[m[32mint ansiFlags_Text(void) {[m [32m+[m[32m return activeText_->ansiFlags;[m [32m+[m[32m}[m [32m+[m void setDocumentFontSize_Text(iText *d, float fontSizeFactor) {[m fontSizeFactor *= contentScale_Text_;[m iAssert(fontSizeFactor > 0);[m [36m@@ -834,7 +838,6 @@[m [mstatic void prepare_AttributedText_(iAttributedText *d, int overrideBaseDir, iCh[m .font = d->font,[m };[m const int *logToSource = constData_Array(&d->logicalToSourceOffset);[m [31m- const int * logToVis = constData_Array(&d->logicalToVisual);[m const iChar * logicalText = constData_Array(&d->logical);[m iBool isRTL = d->isBaseRTL;[m int numNonSpace = 0;[m [36m@@ -874,17 +877,34 @@[m [mstatic void prepare_AttributedText_(iAttributedText *d, int overrideBaseDir, iCh[m /* Note: This styling is hardcoded to match `typesetOneLine_RunTypesetter_()`. */[m if (ansi & allowFontStyle_AnsiFlag && equal_Rangecc(sequence, "1")) {[m run.attrib.bold = iTrue;[m [32m+[m[32m run.attrib.regular = iFalse;[m [32m+[m[32m run.attrib.light = iFalse;[m if (d->baseFgColorId == tmParagraph_ColorId) {[m setFgColor_AttributedRun_(&run, tmFirstParagraph_ColorId);[m }[m attribFont = font_Text_(fontWithStyle_Text(fontId_Text_(d->baseFont),[m bold_FontStyle));[m }[m [32m+[m[32m else if (ansi & allowFontStyle_AnsiFlag && equal_Rangecc(sequence, "2")) {[m [32m+[m[32m run.attrib.light = iTrue;[m [32m+[m[32m run.attrib.regular = iFalse;[m [32m+[m[32m run.attrib.bold = iFalse;[m [32m+[m[32m attribFont = font_Text_(fontWithStyle_Text(fontId_Text_(d->baseFont),[m [32m+[m[32m light_FontStyle));[m [32m+[m[32m }[m else if (ansi & allowFontStyle_AnsiFlag && equal_Rangecc(sequence, "3")) {[m run.attrib.italic = iTrue;[m attribFont = font_Text_(fontWithStyle_Text(fontId_Text_(d->baseFont),[m italic_FontStyle));[m }[m [32m+[m[32m else if (ansi & allowFontStyle_AnsiFlag && equal_Rangecc(sequence, "10")) {[m [32m+[m[32m run.attrib.regular = iTrue;[m [32m+[m[32m run.attrib.bold = iFalse;[m [32m+[m[32m run.attrib.light = iFalse;[m [32m+[m[32m run.attrib.italic = iFalse;[m [32m+[m[32m attribFont = font_Text_(fontWithStyle_Text(fontId_Text_(d->baseFont),[m [32m+[m[32m regular_FontStyle));[m [32m+[m[32m }[m else if (ansi & allowFontStyle_AnsiFlag && equal_Rangecc(sequence, "11")) {[m run.attrib.monospace = iTrue;[m setFgColor_AttributedRun_(&run, tmPreformatted_ColorId);[m [36m@@ -892,7 +912,9 @@[m [mstatic void prepare_AttributedText_(iAttributedText *d, int overrideBaseDir, iCh[m monospace_FontId));[m }[m else if (equal_Rangecc(sequence, "0")) {[m [32m+[m[32m run.attrib.regular = iFalse;[m run.attrib.bold = iFalse;[m [32m+[m[32m run.attrib.light = iFalse;[m run.attrib.italic = iFalse;[m run.attrib.monospace = iFalse;[m attribFont = run.font = d->baseFont;[m [36m@@ -973,6 +995,7 @@[m [mstatic void prepare_AttributedText_(iAttributedText *d, int overrideBaseDir, iCh[m pushBack_Array(&d->runs, &run);[m }[m #if 0[m [32m+[m[32m const int *logToVis = constData_Array(&d->logicalToVisual);[m printf("[AttributedText] %zu runs:\n", size_Array(&d->runs));[m iConstForEach(Array, i, &d->runs) {[m const iAttributedRun *run = i.value;[m [1mdiff --git a/src/ui/text.h b/src/ui/text.h[m [1mindex cb29adad..c8bb6f85 100644[m [1m--- a/src/ui/text.h[m [1m+++ b/src/ui/text.h[m [36m@@ -161,6 +161,7 @@[m [menum iAnsiFlag {[m void setOpacity_Text (float opacity);[m void setBaseAttributes_Text (int fontId, int fgColorId); /* current "normal" text attributes */[m void setAnsiFlags_Text (int ansiFlags);[m [32m+[m[32mint ansiFlags_Text (void);[m [m void cache_Text (int fontId, iRangecc text); /* pre-render glyphs */[m [m [36m@@ -192,7 +193,9 @@[m [mstruct Impl_TextAttrib {[m int16_t fgColorId;[m int16_t bgColorId;[m struct {[m [32m+[m[32m uint16_t regular : 1;[m uint16_t bold : 1;[m [32m+[m[32m uint16_t light : 1;[m uint16_t italic : 1;[m uint16_t monospace : 1;[m uint16_t isBaseRTL : 1;[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).