From 0ffb1582b624630882f4c927b059875a1b797b3d Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 24 Nov 2019 03:01:28 +0000 Subject: [PATCH] textgen: More kerning rules for lower-case letters. I did this by starting from some of the upper-case rules, copying them to generate lower-case versions and then iterating to see what looked good. --- graphics/text/config.py | 65 +++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/graphics/text/config.py b/graphics/text/config.py index 3cb4f09a..0dc78c96 100644 --- a/graphics/text/config.py +++ b/graphics/text/config.py @@ -13,54 +13,61 @@ import re FONT_KERNING_RULES = { # Right character fits under left character: - r"T[07ACOSZa]": -2, - r"Y[7ASZa]": -2, + r"T[0ACOSZacos]": -2, + r"V[OC]": -2, + r"Y[ASZacs]": -2, r"Y[CO0]": -1, - r"P[A]": -3, + r"P[Aa]": -3, r"P[7]": -2, r"P[Z]": -1, - r"7[Z]": -1, - r"[0O]A": -1, + r"[0O][Aa]": -1, r"S[A]": -1, - r"yo": -1, - r"[FStf]a": -2, - r"[Wy]a": -1, + r"Sa": -2, + r"Wa": -1, r"oa": +1, - r"V[0OC]": -2, + r"p[a]": -1, + r"ta": -2, + r"v[oc]": -1, + r"y[oacs]": -1, # Left character fits under right character: - r"L[0OCTY]": -4, - r"L[14Q]": -3, - r"L[9]": -2, - r"L[yVo]": -1, - r"l[t]": -2, + r"L[4Q]": -3, + r"L[O0CTYtcoq]": -2, + r"L[yVv]": -1, + r"l[tTY]": -2, r"l[y]": -1, - r"[0O][4TY]": -2, + r"[0O][4TYy]": -2, r"[0O][1]": -1, r"Q[1TY]": -2, - r"A[CGTY]": -2, - r"A[c]": -1, - r"a[cTYt]": -2, - r"a[vVy]": -1, + r"A[CGTYt]": -2, + r"A[cgy]": -1, + r"a[TYt]": -2, + r"a[cvVy]": -1, # Fits into "hole" in left character: r"B[0CGOQ]": -2, + r"B[0cgq]": -2, r"C[0CGOQ]": -3, r"C[q]": -2, - r"C[Go]": -1, + r"C[cgo]": -1, r"X[0CO]": -3, - r"X[Q]": -2, + r"X[Qqco]": -2, r"8[0CO]": -3, - r"8[GQ]": -2, + r"8[GQcgqo]": -2, r"Z[0CO]": -2, - r"Z[GQo]": -1, - r"I[0COQ]": -1, + r"Z[GQocgq]": -1, + r"I[0COQcoq]": -1, r"K[0CO]": -4, r"K[GQ]": -3, - r"K[E]": -1, - r"[PR][0COQ]": -1, + r"K[cgo]": -2, + r"K[Eq]": -1, + r"P[0COQcoq]": -1, + r"R[0COQcoq]": -1, # Fits into "hole" in right character: - r"[O0Q][2X8]": -3, - r"[O0Q][9K]": -2, - r"[O0Q][I]": -1, + r"[O0][2X8]": -3, + r"[O0][9Kx]": -2, + r"[O0][Iik]": -1, + r"Q[28X]": -2, + r"Q[9Iix]": -1, + r"q[IXx]": -1, # Just because. r"[O0][O0]": -1, }