Skip to content

Commit 5fb79df

Browse files
committed
Update InkPlate10_News.ino
1 parent c2895e1 commit 5fb79df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/Inkplate10/Projects/InkPlate10_News/InkPlate10_News.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void drawNews(struct news *entities)
123123
display.setFont(&FreeSerifItalic24pt7b);
124124
int textWidth = strlen("World News") * 12; // Approximate width (12 pixels per character)
125125
int centerX = (display.width() - textWidth) / 2;
126-
display.setCursor(centerX, 60);
126+
display.setCursor(centerX-70, 60); // -70 to ajust text position to center
127127
display.print("World News");
128128

129129
// Draw a dividing line below the title
@@ -159,18 +159,18 @@ void drawNews(struct news *entities)
159159
timeInfo.tm_min);
160160

161161
// Choose font
162-
display.setFont(&FreeSans12pt7b);
162+
display.setFont(&Inter12pt7b);
163163

164164
// Y position for the row
165165
int yPos = 105;
166166

167167
// Print date left-aligned
168-
display.setCursor(10, yPos); // 10 px from left
168+
display.setCursor(23, yPos); // 23 px from left
169169
display.print(dateStr);
170170

171171
// Calculate width of 'Last update' string for right alignment
172172
int updateStrWidth = strlen(updateStr) * 12; // adjust 12 for your font's avg char width
173-
int xRight = display.width() - updateStrWidth - 10; // 10 px margin from right
173+
int xRight = display.width() - updateStrWidth - 19; // 19 px margin from right
174174

175175
// Print 'Last update' right-aligned
176176
display.setCursor(xRight, yPos);
@@ -199,7 +199,7 @@ void drawNews(struct news *entities)
199199
display.drawTextBox(leftMargin, y0, display.width() - rightMargin, y0 + 80, entities[i].title, 1, &GT_Pressura16pt7b, 30, false, 18);
200200

201201
// Draw the description
202-
display.drawTextBox(leftMargin, y0 + 80, display.width() - rightMargin, y1 + 20, entities[i].description, 1, &FreeSerifItalic12pt7b, 30, false, 16);
202+
display.drawTextBox(leftMargin, y0 + 80, display.width() - rightMargin, y1 + 20, entities[i].description, 1, &Inter12pt7b, 30, false, 16);
203203
}
204204
}
205205

0 commit comments

Comments
 (0)