summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-31 09:22:16 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-31 09:22:16 +0300
commitc80099f89383f9bc4638cb60ecd43219b71fc5aa (patch)
treeb520c4dfdf5f6481829b2002fc6179df9d78cb00 /src/ui
parent07022bc768a8f23cf051dc6a58e85195886478d5 (diff)
Text: Removing the baseline offset hack
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/text.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/ui/text.c b/src/ui/text.c
index dee693e4..1b483952 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -59,15 +59,13 @@ struct Impl_Font {
59 int baseline; 59 int baseline;
60 iHash glyphs; 60 iHash glyphs;
61 iBool enableKerning; 61 iBool enableKerning;
62 int baselineOffset;
63 enum iFontId symbolsFont; /* font to use for symbols */ 62 enum iFontId symbolsFont; /* font to use for symbols */
64}; 63};
65 64
66static iFont *font_Text_(enum iFontId id); 65static iFont *font_Text_(enum iFontId id);
67 66
68static void init_Font(iFont *d, const iBlock *data, int height, int bloff, enum iFontId symbolsFont) { 67static void init_Font(iFont *d, const iBlock *data, int height, enum iFontId symbolsFont) {
69 init_Hash(&d->glyphs); 68 init_Hash(&d->glyphs);
70 d->baselineOffset = bloff;
71 d->data = NULL; 69 d->data = NULL;
72 d->height = height; 70 d->height = height;
73 iZap(d->font); 71 iZap(d->font);
@@ -171,7 +169,6 @@ void init_Text(SDL_Renderer *render) {
171 init_Font(font, 169 init_Font(font,
172 fontData[i].ttf, 170 fontData[i].ttf,
173 fontData[i].size, 171 fontData[i].size,
174 i == 0 ? fontSize_UI / 18 : 0,
175 fontData[i].symbolsFont); 172 fontData[i].symbolsFont);
176 if (fontData[i].ttf == &fontFiraMonoRegular_Embedded) { 173 if (fontData[i].ttf == &fontFiraMonoRegular_Embedded) {
177 font->enableKerning = iFalse; 174 font->enableKerning = iFalse;
@@ -262,7 +259,6 @@ static void cache_Font_(iFont *d, iGlyph *glyph, int hoff) {
262 &glyph->d[hoff].y, 259 &glyph->d[hoff].y,
263 NULL, 260 NULL,
264 NULL); 261 NULL);
265 glyph->d[hoff].y += d->baselineOffset;
266 tex = SDL_CreateTextureFromSurface(render, surface); 262 tex = SDL_CreateTextureFromSurface(render, surface);
267 glRect->size = init_I2(surface->w, surface->h); 263 glRect->size = init_I2(surface->w, surface->h);
268 } 264 }