textgen: Tweak kerning to add more lower-case rules.

Resolve TODO as part of this. This improves some of the intermission
screen level title graphics.
master
Simon Howard 2019-11-24 01:52:22 +00:00
parent 0f7e672fa9
commit 24f73c9d1a
1 changed files with 30 additions and 19 deletions

View File

@ -11,45 +11,56 @@ import re
# visually appealing. This is highly dependent on the font graphics,
# and if the font is changed this probably needs to be redone.
# TODO: Add more rule for lower-case characters.
FONT_KERNING_RULES = {
# Right character fits under left character:
r"[TY][07ACOSZ]": -2,
r"[TYty][a]": -2,
r"T[07ACOSZa]": -2,
r"Y[7ASZa]": -2,
r"Y[CO0]": -1,
r"P[A]": -3,
r"P[7]": -2,
r"P[Z]": -1,
r"7[Z]": -1,
r"[0OQ]A": -1,
r"[0O]A": -1,
r"S[A]": -1,
r"yo": -1,
r"[FStf]a": -2,
r"[Wy]a": -1,
r"oa": +1,
r"V[0OC]": -2,
# Left character fits under right character:
r"L[TY]": -4,
r"L[014COQV]": -3,
r"L[0OCTY]": -4,
r"L[14Q]": -3,
r"L[9]": -2,
r"L[yVo]": -1,
r"l[t]": -2,
r"l[y]": -1,
r"[0O][4TY]": -2,
r"[0O][1]": -1,
r"Q[1T]": -2,
r"Q[Y]": -1,
r"A[TYV]": -2,
r"A[GC]": -1,
r"a[TYty]": -2,
r"a[vV]": -2,
r"a[g]": -1,
r"Q[1TY]": -2,
r"A[CGTY]": -2,
r"A[c]": -1,
r"a[cTYt]": -2,
r"a[vVy]": -1,
# Fits into "hole" in left character:
r"[BCX8][0CGOQ]": -2,
r"B[0CGOQ]": -2,
r"C[0CGOQ]": -3,
r"C[q]": -2,
r"C[Go]": -1,
r"X[0CO]": -3,
r"X[Q]": -2,
r"8[0CO]": -3,
r"8[GQ]": -2,
r"Z[0CO]": -2,
r"Z[GQ]": -1,
r"Z[GQo]": -1,
r"I[0COQ]": -1,
r"K[0CO]": -4,
r"K[GQ]": -3,
r"K[E]": -1,
r"[PR][0COQ]": -1,
# Fits into "hole" in right character:
r"[O0Q][X]": -3,
r"[O0Q][28]": -2,
r"[O0Q][9IK]": -1,
r"[O0Q][2X8]": -3,
r"[O0Q][9K]": -2,
r"[O0Q][I]": -1,
# Just because.
r"[O0][O0]": -1,
}