summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-22 16:20:33 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-22 16:20:45 +0300
commit514bd9ac87f4bb4d70f7512120b15b42f28966db (patch)
tree81604ae0673f8130d165c7866d4bd1e7d7b67fc7 /src
parente0e53e4a51afcbd22345d12416645d3fc5483a18 (diff)
GmDocument: Trying a first paragraph emphasis
Diffstat (limited to 'src')
-rw-r--r--src/gmdocument.c8
-rw-r--r--src/ui/text.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 3f3f8358..42bc7515 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -97,6 +97,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
97 static const char *bullet = "\u2022"; 97 static const char *bullet = "\u2022";
98 iRangecc preAltText = iNullRange; 98 iRangecc preAltText = iNullRange;
99 enum iGmLineType prevType = text_GmLineType; 99 enum iGmLineType prevType = text_GmLineType;
100 iBool isFirstText = iTrue;
100 while (nextSplit_Rangecc(&content, "\n", &line)) { 101 while (nextSplit_Rangecc(&content, "\n", &line)) {
101 iGmRun run; 102 iGmRun run;
102 run.color = white_ColorId; 103 run.color = white_ColorId;
@@ -150,6 +151,13 @@ static void doLayout_GmDocument_(iGmDocument *d) {
150 run.text = (iRangecc){ bullet, bullet + strlen(bullet) }; 151 run.text = (iRangecc){ bullet, bullet + strlen(bullet) };
151 pushBack_Array(&d->layout, &run); 152 pushBack_Array(&d->layout, &run);
152 } 153 }
154 if (type == text_GmLineType && isFirstText) {
155 run.font = firstParagraph_FontId;
156 isFirstText = iFalse;
157 }
158 else if (type != header1_GmLineType) {
159 isFirstText = iFalse;
160 }
153 iRangecc runLine = line; 161 iRangecc runLine = line;
154 while (!isEmpty_Range(&runLine)) { 162 while (!isEmpty_Range(&runLine)) {
155 run.bounds.pos = addX_I2(pos, indent * gap_UI); 163 run.bounds.pos = addX_I2(pos, indent * gap_UI);
diff --git a/src/ui/text.c b/src/ui/text.c
index afad778c..a24d4030 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -117,7 +117,7 @@ void init_Text(SDL_Renderer *render) {
117 const struct { const iBlock *ttf; int size; } fontData[max_FontId] = { 117 const struct { const iBlock *ttf; int size; } fontData[max_FontId] = {
118 { &fontFiraSansRegular_Embedded, fontSize_UI }, 118 { &fontFiraSansRegular_Embedded, fontSize_UI },
119 { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.85f }, 119 { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.85f },
120 { &fontFiraSansRegular_Embedded, fontSize_UI * 1.5f }, 120 { &fontFiraSansRegular_Embedded, fontSize_UI * 1.35f },
121 { &fontFiraSansLightItalic_Embedded, fontSize_UI }, 121 { &fontFiraSansLightItalic_Embedded, fontSize_UI },
122 { &fontFiraSansBold_Embedded, fontSize_UI }, 122 { &fontFiraSansBold_Embedded, fontSize_UI },
123 { &fontFiraSansBold_Embedded, fontSize_UI * 1.35f }, 123 { &fontFiraSansBold_Embedded, fontSize_UI * 1.35f },