From dcf520652cd2279a1d4dd78361d589ede0c36eaf Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Thu, 24 Jun 2021 07:19:09 +0300

Subject: [PATCH 1/1] Text: Tune kerning on Nunito


src/ui/text.c | 28 +++++++++++++++++++++++++---

src/ui/text.h | 3 ++-

2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/src/ui/text.c b/src/ui/text.c

index db922715..51865654 100644

--- a/src/ui/text.c

+++ b/src/ui/text.c

@@ -116,6 +116,7 @@ iDefineTypeConstructionArgs(Glyph, (iChar ch), ch)

struct Impl_Font {

 iBlock *       data;

 stbtt_fontinfo font;

 float          xScale, yScale;

 int            vertOffset; /* offset due to scaling */

@@ -134,6 +135,15 @@ static void init_Font(iFont *d, const iBlock *data, int height, float scale,

                   enum iFontSize sizeId, iBool isMonospaced) {

 init_Hash(&d->glyphs);

 d->data = NULL;

 d->isMonospaced = isMonospaced;

 d->height = height;

 iZap(d->font);

@@ -1128,14 +1138,26 @@ static iRect run_Font_(iFont *d, const iRunArgs *args) {

         const iChar next = nextChar_(&peek, args->text.end);

         if (enableKerning_Text && !d->manualKernOnly && next) {

             const uint32_t nextGlyphIndex = glyphIndex_Font_(glyph->font, next);

                 &glyph->font->font, glyph->glyphIndex, nextGlyphIndex);

             if (kern) {

// printf("%lc(%u) -> %lc(%u): kern %d (%f)\n", ch, glyph->glyphIndex, next,

// nextGlyphIndex,

// kern, d->xScale * kern);

             }

         }

     }

diff --git a/src/ui/text.h b/src/ui/text.h

index 2f2bcf3a..768713ee 100644

--- a/src/ui/text.h

+++ b/src/ui/text.h

@@ -116,7 +116,8 @@ iLocalDef iBool isJapanese_FontId(enum iFontId id) {

#define emojiVariationSelector_Char ((iChar) 0xfe0f)

enum iTextFont {

 firaSans_TextFont,

 literata_TextFont,

 tinos_TextFont,

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.6/patch/dcf520652cd2279a1d4dd78361d589ede0c36eaf.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
62.519958 milliseconds
Gemini-to-HTML Time
1.15312 milliseconds

This content has been proxied by September (3851b).