[1mdiff --git a/CMakeLists.txt b/CMakeLists.txt[m
[1mindex 995432cb..394f1b6b 100644[m
[1m--- a/CMakeLists.txt[m
[1m+++ b/CMakeLists.txt[m
[36m@@ -61,7 +61,7 @@[m [mset (EMBED_RESOURCES[m
res/fonts/Tinos-Regular.ttf[m
res/fonts/Tinos-Italic.ttf[m
res/fonts/Tinos-Bold.ttf[m
[31m- res/fonts/FiraMono-Regular.ttf[m
[32m+[m[32m res/fonts/IosevkaTerm-Extended.ttf[m
res/fonts/FiraSans-Bold.ttf[m
res/fonts/FiraSans-Italic.ttf[m
res/fonts/FiraSans-Light.ttf[m
[1mdiff --git a/res/about/license.gmi b/res/about/license.gmi[m
[1mindex 0ea0897a..d5ffe3c4 100644[m
[1m--- a/res/about/license.gmi[m
[1m+++ b/res/about/license.gmi[m
[36m@@ -100,7 +100,8 @@[m [mThe libunistring library is covered by the GNU Lesser General Public License (LG[m
[m
This application uses fonts licensed under the Open Font License.[m
[m
[31m-=> https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans, Fira Mono[m
[32m+[m[32m=> https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans[m
[32m+[m[32m=> https://typeof.net/Iosevka/ Iosevka[m
=> https://github.com/googlefonts/literata/blob/master/OFL.txt Literata[m
=> https://github.com/google/fonts/blob/master/ofl/nanumgothic/OFL.txt Nanum Gothic[m
=> https://www.google.com/get/noto/help/cjk/ Noto Sans CJK JP[m
[1mdiff --git a/res/about/version.gmi b/res/about/version.gmi[m
[1mindex 42475e13..1932baa1 100644[m
[1m--- a/res/about/version.gmi[m
[1m+++ b/res/about/version.gmi[m
[36m@@ -8,9 +8,9 @@[m
[m
[31m-* IDNs show up in decoded form in the UI.[m
[32m+[m[32m* UI shows decoded IDNs.[m
[31m-* Added option to disable decoding of percent-encoded paths.[m
[32m+[m[32m* Added option to disable decoding of percent-encoded paths for the UI.[m
[36m@@ -19,6 +19,7 @@[m
[32m+[m[32m* Fixed use of variable-width fonts in input fields.[m
[m
[1mdiff --git a/res/fonts/FiraMono-Regular.ttf b/res/fonts/FiraMono-Regular.ttf[m
[1mdeleted file mode 100644[m
[1mindex 59e1e1a1..00000000[m
Binary files a/res/fonts/FiraMono-Regular.ttf and /dev/null differ
[1mdiff --git a/res/fonts/IosevkaTerm-Extended.ttf b/res/fonts/IosevkaTerm-Extended.ttf[m
[1mnew file mode 100644[m
[1mindex 00000000..16989a85[m
Binary files /dev/null and b/res/fonts/IosevkaTerm-Extended.ttf differ
[1mdiff --git a/src/ui/text.c b/src/ui/text.c[m
[1mindex 4229217c..ec240c75 100644[m
[1m--- a/src/ui/text.c[m
[1m+++ b/src/ui/text.c[m
[36m@@ -120,10 +120,10 @@[m [mstatic void init_Font(iFont *d, const iBlock *data, int height, float scale,[m
d->xScale *= floorf(advance) / advance;[m
}[m
}[m
[31m- d->vertOffset = height * (1.0f - scale) / 2;[m
[32m+[m[32m d->vertOffset = height * (1.0f - scale) / 2;[m[41m [m
int ascent;[m
stbtt_GetFontVMetrics(&d->font, &ascent, NULL, NULL);[m
[31m- d->baseline = ceil(ascent * d->yScale);[m
[32m+[m[32m d->baseline = /ceil/(ascent * d->yScale);[m
d->symbolsFont = symbolsFont;[m
d->japaneseFont = regularJapanese_FontId;[m
d->koreanFont = regularKorean_FontId;[m
[36m@@ -176,8 +176,8 @@[m [mstatic iText text_;[m
[m
static void initFonts_Text_(iText *d) {[m
const float textSize = fontSize_UI * d->contentFontSize;[m
[31m- const float monoSize = fontSize_UI * d->contentFontSize / contentScale_Text_ * 0.866f;[m
[31m- const float smallMonoSize = monoSize * 0.866f;[m
[32m+[m[32m const float monoSize = textSize * 0.71f; //fontSize_UI * d->contentFontSize / contentScale_Text_ * 1.0f; //0.866f;[m
[32m+[m[32m const float smallMonoSize = monoSize * 0.8f;[m
const iBlock *regularFont = &fontNunitoRegular_Embedded;[m
const iBlock *italicFont = &fontNunitoLightItalic_Embedded;[m
const iBlock *h12Font = &fontNunitoExtraBold_Embedded;[m
[36m@@ -226,12 +226,12 @@[m [mstatic void initFonts_Text_(iText *d) {[m
{ &fontSourceSansProRegular_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId },[m
{ &fontSourceSansProRegular_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId },[m
{ &fontSourceSansProRegular_Embedded, fontSize_UI * 1.666f, 1.0f, defaultLargeSymbols_FontId },[m
[31m- { &fontFiraMonoRegular_Embedded, fontSize_UI * 0.866f, 1.0f, defaultSymbols_FontId },[m
[32m+[m[32m { &fontIosevkaTermExtended_Embedded, fontSize_UI * 0.866f, 1.0f, defaultSymbols_FontId },[m
{ &fontSourceSansProRegular_Embedded, textSize, scaling, symbols_FontId },[m
/* content fonts */[m
{ regularFont, textSize, scaling, symbols_FontId },[m
[31m- { &fontFiraMonoRegular_Embedded, monoSize, 1.0f, monospaceSymbols_FontId },[m
[31m- { &fontFiraMonoRegular_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId },[m
[32m+[m[32m { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, monospaceSymbols_FontId },[m
[32m+[m[32m { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, monospaceSmallSymbols_FontId },[m
{ regularFont, textSize * 1.200f, scaling, mediumSymbols_FontId },[m
{ h3Font, textSize * 1.333f, h123Scaling, bigSymbols_FontId },[m
{ italicFont, textSize, scaling, symbols_FontId },[m
[36m@@ -239,7 +239,7 @@[m [mstatic void initFonts_Text_(iText *d) {[m
{ h12Font, textSize * 2.000f, h123Scaling, hugeSymbols_FontId },[m
{ lightFont, textSize * 1.666f, lightScaling, largeSymbols_FontId },[m
/* monospace content fonts */[m
[31m- { &fontFiraMonoRegular_Embedded, textSize, 0.8f, symbols_FontId },[m
[32m+[m[32m { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, symbols_FontId },[m
/* symbol fonts */[m
{ &fontSymbola_Embedded, fontSize_UI, 1.0f, defaultSymbols_FontId },[m
{ &fontSymbola_Embedded, fontSize_UI * 1.125f, 1.0f, defaultMediumSymbols_FontId },[m
[36m@@ -288,7 +288,7 @@[m [mstatic void initFonts_Text_(iText *d) {[m
fontData[i].size,[m
fontData[i].scaling,[m
fontData[i].symbolsFont,[m
[31m- fontData[i].ttf == &fontFiraMonoRegular_Embedded);[m
[32m+[m[32m fontData[i].ttf == &fontIosevkaTermExtended_Embedded);[m
if (i == default_FontId || i == defaultMedium_FontId) {[m
font->manualKernOnly = iTrue;[m
}[m
[36m@@ -636,6 +636,7 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
iRect bounds = zero_Rect();[m
const iInt2 orig = pos;[m
float xpos = pos.x;[m
[32m+[m[32m float xposExtend = pos.x; /* allows wide glyphs to use more space; restored by whitespace */[m
float xposMax = xpos;[m
float monoAdvance = 0;[m
iAssert(xposLimit == 0 || isMeasuring_(mode));[m
[36m@@ -668,6 +669,7 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
}[m
}[m
iChar ch = nextChar_(&chPos, text.end);[m
[32m+[m[32m iBool isEmoji = isEmoji_Char(ch);[m
if (ch == 0x200d) { /* zero-width joiner */[m
/* We don't have the composited Emojis. */[m
if (isEmoji_Char(prevCh)) {[m
[36m@@ -676,9 +678,19 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
ch = nextChar_(&chPos, text.end);[m
}[m
}[m
[32m+[m[32m#if 0[m
[32m+[m[32m iChar nextCh = 0; {[m
[32m+[m[32m /* TODO: Since we're peeking ahead, should use this on the next loop iteration. */[m
[32m+[m[32m const char *ncp = chPos;[m
[32m+[m[32m nextCh = nextChar_(&ncp, text.end);[m
[32m+[m[32m }[m
[32m+[m[32m /* VS15: Peek ahead and treat as Emoji font. */[m
[32m+[m[32m if (nextCh == emojiVariationSelector_Char) {[m
[32m+[m[32m isEmoji = iTrue;[m
[32m+[m[32m }[m
[32m+[m[32m#endif[m
if (isVariationSelector_Char(ch)) {[m
[31m- /* TODO: VS15: Should peek ahead for this and prefer the Emoji font. */[m
[31m- ch = nextChar_(&chPos, text.end); /* just ignore */[m
[32m+[m[32m ch = nextChar_(&chPos, text.end); /* skip it */[m
}[m
/* Special instructions. */ {[m
if (ch == 0xad) { /* soft hyphen */[m
[36m@@ -703,7 +715,7 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
}[m
}[m
if (ch == '\n') {[m
[31m- xpos = pos.x;[m
[32m+[m[32m xpos = xposExtend = pos.x;[m
pos.y += d->height;[m
prevCh = ch;[m
continue;[m
[36m@@ -711,6 +723,7 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
if (ch == '\t') {[m
const int tabStopWidth = d->height * 8;[m
xpos = pos.x + ((int) ((xpos - pos.x) / tabStopWidth) + 1) * tabStopWidth;[m
[32m+[m[32m xposExtend = iMax(xposExtend, xpos);[m
prevCh = 0;[m
continue;[m
}[m
[36m@@ -728,7 +741,7 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
}[m
}[m
const iGlyph *glyph = glyph_Font_(d, ch);[m
[31m- int x1 = xpos;[m
[32m+[m[32m int x1 = iMax(xpos, xposExtend);[m
const int hoff = enableHalfPixelGlyphs_Text ? (xpos - x1 > 0.5f ? 1 : 0) : 0;[m
int x2 = x1 + glyph->rect[hoff].size.x;[m
/* Out of the allotted space? */[m
[36m@@ -765,11 +778,13 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
bounds.size.x = iMax(bounds.size.x, x2 - orig.x);[m
bounds.size.y = iMax(bounds.size.y, pos.y + glyph->font->height - orig.y);[m
}[m
[32m+[m[32m /* Symbols and emojis are NOT monospaced, so must conform when the primary font[m
[32m+[m[32m is monospaced. Except with Japanese script, that's larger than the normal monospace. */[m
const iBool useMonoAdvance =[m
monoAdvance > 0 && !isJapanese_FontId(fontId_Text_(glyph->font));[m
const float advance = (useMonoAdvance ? monoAdvance : glyph->advance);[m
if (!isMeasuring_(mode)) {[m
[31m- if (useMonoAdvance && dst.w > advance && glyph->font != d) {[m
[32m+[m[32m if (useMonoAdvance && dst.w > advance && glyph->font != d && !isEmoji) {[m
/* Glyphs from a different font may need recentering to look better. */[m
dst.x -= (dst.w - advance) / 2;[m
}[m
[36m@@ -784,10 +799,12 @@[m [mstatic iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe[m
}[m
SDL_RenderCopy(text_.render, text_.cache, &src, &dst);[m
}[m
[31m- /* Symbols and emojis are NOT monospaced, so must conform when the primary font[m
[31m- is monospaced. Except with Japanese script, that's larger than the normal monospace. */[m
xpos += advance;[m
[31m- xposMax = iMax(xposMax, xpos);[m
[32m+[m[32m if (!isSpace_Char(ch)) {[m
[32m+[m[32m xposExtend += isEmoji ? glyph->advance : advance;[m
[32m+[m[32m }[m
[32m+[m[32m xposExtend = iMax(xposExtend, xpos);[m
[32m+[m[32m xposMax = iMax(xposMax, xposExtend);[m
if (continueFrom_out && ((mode & noWrapFlag_RunMode) || isWrapBoundary_(prevCh, ch))) {[m
lastWordEnd = chPos;[m
}[m
[1mdiff --git a/src/ui/text.h b/src/ui/text.h[m
[1mindex 6728bb62..5867a84b 100644[m
[1m--- a/src/ui/text.h[m
[1m+++ b/src/ui/text.h[m
[36m@@ -127,7 +127,8 @@[m [miLocalDef iBool isDefaultIgnorable_Char(iChar c) {[m
c == 0xfeff;[m
}[m
iLocalDef iBool isEmoji_Char(iChar c) {[m
[31m- return (c >= 0x1f300 && c < 0x1f700) || (c >= 0x1f900 && c <= 0x1f9ff);[m
[32m+[m[32m return (c >= 0x1f300 && c < 0x1f700) || (c >= 0x1f7e0 && c <= 0x1f7eb) ||[m
[32m+[m[32m (c >= 0x1f900 && c <= 0x1f9ff);[m
}[m
[m
#define emojiVariationSelector_Char ((iChar) 0xfe0f)[m
[36m@@ -141,21 +142,21 @@[m [menum iTextFont {[m
[m
extern int gap_Text; /* affected by content font size */[m
[m
[31m-void init_Text (SDL_Renderer *);[m
[31m-void deinit_Text (void);[m
[32m+[m[32mvoid init_Text (SDL_Renderer *);[m
[32m+[m[32mvoid deinit_Text (void);[m
[m
void setContentFont_Text (enum iTextFont font);[m
void setHeadingFont_Text (enum iTextFont font);[m
void setContentFontSize_Text (float fontSizeFactor); /* affects all except default*
fonts */[m
void resetFonts_Text (void);[m
[m
[31m-int lineHeight_Text (int fontId);[m
[31m-iInt2 measure_Text (int fontId, const char *text);[m
[31m-iInt2 measureRange_Text (int fontId, iRangecc text);[m
[31m-iRect visualBounds_Text (int fontId, iRangecc text);[m
[31m-iInt2 advance_Text (int fontId, const char *text);[m
[31m-iInt2 advanceN_Text (int fontId, const char text, size_t n); / n
in characters */[m
[31m-iInt2 advanceRange_Text (int fontId, iRangecc text);[m
[32m+[m[32mint lineHeight_Text (int fontId);[m
[32m+[m[32miInt2 measure_Text (int fontId, const char *text);[m
[32m+[m[32miInt2 measureRange_Text (int fontId, iRangecc text);[m
[32m+[m[32miRect visualBounds_Text (int fontId, iRangecc text);[m
[32m+[m[32miInt2 advance_Text (int fontId, const char *text);[m
[32m+[m[32miInt2 advanceN_Text (int fontId, const char text, size_t n); / n
in characters */[m
[32m+[m[32miInt2 advanceRange_Text (int fontId, iRangecc text);[m
iInt2 advanceWrapRange_Text (int fontId, int maxWidth, iRangecc text);[m
[m
iInt2 tryAdvance_Text (int fontId, iRangecc text, int width, const char **endPos);[m
text/plain
This content has been proxied by September (ba2dc).