Optimize the newstroke font representation

Remove redundant strokes that start where the last stroke ended.
This commit is contained in:
Kuba Sunderland-Ober 2024-06-24 19:44:06 +00:00 committed by Seth Hillbrand
parent 8507ffa338
commit 8f02944437
2 changed files with 24 additions and 25 deletions

View File

@ -384,7 +384,7 @@ const char* const newstroke_font[] =
"I\\W[WPVNTMPMNN RWZU[P[NZMXMVNTPSUSWR RMGWG",
"I[MUWU RK[RFY[ RN>O@QASAU@V>",
"I\\W[WPVNTMPMNN RWZU[P[NZMXMVNTPSUSWR RNEOGQHSHUGVE",
"I[MUWU RK[RFY[ RY[W]V_WaYb[b",
"I[MUWU RK[RFY[W]V_WaYb[b",
"I\\W[WPVNTMPMNN RWZU[P[NZMXMVNTPSUSWR RW[U]T_UaWbYb",
"F[WYVZS[Q[NZLXKVJRJOKKLINGQFSFVGWH RT>QA",
"HZVZT[P[NZMYLWLQMONNPMTMVN RTEQH",
@ -552,11 +552,11 @@ const char* const newstroke_font[] =
"IZVZT[P[NZMXMWNUPTSTUSVQVPUNSMPMNN",
"H[W[L[SPLFWF",
"JYWbUbSaR_RIQGOFMGLIMKOLQKRI",
"MYOMWM RRFRXSZU[W[ RW[W_VaTbRb",
"MYOMWM RRFRXSZU[W[W_VaTbRb",
"HZR[RF RKKKILGNFXF",
"MYOMWM RWFUFSGRIRXSZU[W[",
"JZLFXF RR[RF RR[R_SaUbWb",
"G]LFLWMYNZP[T[VZWYXWXF RXFZE[CZAY@",
"G]LFLWMYNZP[T[VZWYXWXFZE[CZAY@",
"H[VMV[ RMMMXNZP[S[UZVY RVMXLYJXHWG", /* U+1B0 U_SMALL HORN */
"F^ZFUFUJWKYMZPZUYXWZT[P[MZKXJUJPKMMKOJOFJF",
"G]LFLWMYNZP[T[VZXXYVYIXGWF",
@ -673,8 +673,8 @@ const char* const newstroke_font[] =
"IbWFWXXZZ[\\[^Z_X^V\\UZVV^ RWNUMQMONNOMQMWNYOZQ[T[VZWX",
"G]NFLGKIKKLMMNOO RVFXGYIYKXMWNUO ROOUOWPXQYSYWXYWZU[O[MZLYKWKSLQMPOO",
"J[MJMMNORQVOWMWJ RPQTQVRWTWXVZT[P[NZMXMTNRPQ",
"H\\KFYFK[Y[ RY[Y_XaVbTb",
"IZLMWML[W[ RW[W_VaTbRb",
"H\\KFYFK[Y[Y_XaVbTb",
"IZLMWML[W[W_VaTbRb",
"I[MUWU RK[RFY[ RR?Q@RAS@R?RA",
"I\\W[WPVNTMPMNN RWZU[P[NZMXMVNTPSUSWR RRFQGRHSGRFRH",
"H[MPTP RW[M[MFWF RR\\T]U_TaRbOb",
@ -751,9 +751,9 @@ const char* const newstroke_font[] =
"GZLFLXMZO[ RLMVMOVRVTWUXVZV^U`TaRbObMa",
"D`[M[[ R[YZZX[U[SZRXRM RRXQZO[L[JZIXIM",
"D`[M[[ R[YZZX[U[SZRXRM RRXQZO[L[JZIXIM R[[[b", /* U+270 +M_SMALL LEG */
"D`I[IM RIOJNLMOMQNRPR[ RRPSNUMXMZN[P[[ R[[[_ZaXbVb",
"D`I[IM RIOJNLMOMQNRPR[ RRPSNUMXMZN[P[[[_ZaXbVb",
"I\\NMN[ RNOONQMTMVNWPW[ RN[N_MaKbIb",
"I\\NMN[ RNOONQMTMVNWPW[ RW[W_XaZb\\b",
"I\\NMN[ RNOONQMTMVNWPW[W_XaZb\\b",
"H[M[MMV[VM",
"H[LTWT RP[NZMYLWLQMONNPMSMUNVOWQWWVYUZS[P[",
"E]RTXT RRMR[ RZMMMKNJOIQIWJYKZM[Z[",
@ -782,7 +782,7 @@ const char* const newstroke_font[] =
"G]Z[VMRWNMJ[",
"JZW[RM RM[RMTHUGWF",
"KYRTR[ RMMRTWM",
"IZLMWML[W[ RW[W_XaZb\\b", /* U+290 Z_SMALL !HOOK */
"IZLMWML[W[W_XaZb\\b", /* U+290 Z_SMALL !HOOK */
"IZLMWML[T[VZWXVVTURVN^",
"JZMMVMOVRVTWUXVZV^U`TaRbObMa",
"JZMMVMOVRVTWUXVZV^U`TaRbPbNaM_N]P\\R]Uc",
@ -1292,8 +1292,8 @@ const char* const newstroke_font[] =
"KZLIMGOFRFUGXG",
":j>R?PAOCPDR RC^D\\F[H\\I^ RCFDDFCHDIF ROcPaR`TaUc ROAP?R>T?UA R[^\\\\^[`\\a^ R[F\\D^C`DaF R`RaPcOePfR",
":jDQ>Q RH[D_ RHGDC RR_Re RRCR= R\\[`_ R\\G`C R`QfQ",
"G]LFL[XFX[ RX[[[Ub RN>O@QASAU@V>",
"H\\MMM[WMW[ RW[Z[Tb RNEOGQHSHUGVE",
"G]LFL[XFX[[[Ub RN>O@QASAU@V>",
"H\\MMM[WMW[Z[Tb RNEOGQHSHUGVE",
"H]MFM[S[VZXXYVYSXQVOSNMN RJIPI",
"IZKMQM RNFN[S[UZVXVUUSSRNR",
"G\\L[LFTFVGWHXJXMWOVPTQLQ RTMXS",
@ -1317,7 +1317,7 @@ const char* const newstroke_font[] =
"E\\X[OO RXFLR RGFLFL[", /* U+4A0 K_CAP_BASHKIR */
"HZPSV[ RVMNU RJMNMN[",
"G]L[LF RLPXP RX[XF RX[Z[Z`",
"H[MTVT RMMM[ RVMV[ RV[X[X`",
"H[MTVT RMMM[ RVMV[X[X`",
"GeL[LF RLPXP RX[XFcF",
"H`MTVT RMMM[ RV[VM^M",
"GhL[LFXFX[ RXM^MaNcPdSd\\c_aa^b\\b",
@ -1327,7 +1327,7 @@ const char* const newstroke_font[] =
"F[WYVZS[Q[NZLXKVJRJOKKLINGQFSFVGWH RR\\T]U_TaRbOb",
"HZVZT[P[NZMYLWLQMONNPMTMVN RR\\T]U_TaRbOb",
"JZLFXF RR[RF RR[T[T`",
"KYMMWM RRMR[ RR[T[T`",
"KYMMWM RRMR[T[T`",
"I[RQR[ RKFRQYF",
"JZR[Rb RMMR[WM",
"I[RQR[ RKFRQYF RNUVU", /* U+4B0 Y_CAP STROKE_H */
@ -1354,13 +1354,13 @@ const char* const newstroke_font[] =
"F\\W[WFTFQGOINLLXKZI[H[ RW[Z[Tb",
"I[V[VMSMQNPPOXNZL[ RV[Y[Sb",
"G]L[LF RLPXP RX[XF RX[X_WaUbSb",
"H[MTVT RMMM[ RVMV[ RV[V_UaSbQb",
"H[MTVT RMMM[ RVMV[V_UaSbQb",
"G]L[LF RLPXP RX[XF RX[[[Ub",
"H[MTVT RMMM[ RVMV[ RV[Y[Sb",
"H[MTVT RMMM[ RVMV[Y[Sb",
"H\\WFW[ RLFLNMPNQPRWR RW[U[U`",
"J\\VMV[ RNMNROTQUVU RV[T[T`",
"F^K[KFRUYFY[ RY[\\[Vb",
"G]L[LMRXXMX[ RX[[[Ub",
"F^K[KFRUYFY[\\[Vb",
"G]L[LMRXXMX[[[Ub",
"MWR[RF",
"I[MUWU RK[RFY[ RN>O@QASAU@V>", /* U+4D0 A_CAP BREVE */
"I\\W[WPVNTMPMNN RWZU[P[NZMXMVNTPSUSWR RNEOGQHSHUGVE",
@ -8088,7 +8088,7 @@ const char* const newstroke_font[] =
"H[P[NZMYLWLQMONNPMSMUNVOWQWWVYUZS[P[ RUNWMXKWIVH RPESH",
"G]PFTFVGXIYMYTXXVZT[P[NZLXKTKMLINGPF RVGXFYDXBWA RRAT?U=T;R:P:",
"H[P[NZMYLWLQMONNPMSMUNVOWQWWVYUZS[P[ RUNWMXKWIVH RRHTFUDTBRAPA",
"G]PFTFVGXIYMYTXXVZT[P[NZLXKTKMLINGPF RVGXFYDXBWA RWAVBTCPANBMC", /* U+1EE0 O_CAP HORN */
"G]PFTFVGXIYMYTXXVZT[P[NZLXKTKMLINGPF RVGXFYDXBWAVBTCPANBMC", /* U+1EE0 O_CAP HORN */
"H[P[NZMYLWLQMONNPMSMUNVOWQWWVYUZS[P[ RUNWMXKWIVH RWHVITJPHNIMJ",
"G]PFTFVGXIYMYTXXVZT[P[NZLXKTKMLINGPF RVGXFYDXBWA RRbSaR`QaRbR`",
"H[P[NZMYLWLQMONNPMSMUNVOWQWWVYUZS[P[ RUNWMXKWIVH RRbSaR`QaRbR`",
@ -8096,15 +8096,15 @@ const char* const newstroke_font[] =
"H[VMV[ RMMMXNZP[S[UZVY RRbSaR`QaRbR`",
"G]LFLWMYNZP[T[VZWYXWXF RRAT?U=T;R:P:",
"H[VMV[ RMMMXNZP[S[UZVY RRHTFUDTBRAPA",
"G]LFLWMYNZP[T[VZWYXWXF RXFZE[CZAY@ RT>QA",
"G]LFLWMYNZP[T[VZWYXWXFZE[CZAY@ RT>QA",
"H[VMV[ RMMMXNZP[S[UZVY RVMXLYJXHWG RTEQH",
"G]LFLWMYNZP[T[VZWYXWXF RXFZE[CZAY@ RP>SA",
"G]LFLWMYNZP[T[VZWYXWXFZE[CZAY@ RP>SA",
"H[VMV[ RMMMXNZP[S[UZVY RVMXLYJXHWG RPESH",
"G]LFLWMYNZP[T[VZWYXWXF RXFZE[CZAY@ RRAT?U=T;R:P:",
"G]LFLWMYNZP[T[VZWYXWXFZE[CZAY@ RRAT?U=T;R:P:",
"H[VMV[ RMMMXNZP[S[UZVY RVMXLYJXHWG RRHTFUDTBRAPA",
"G]LFLWMYNZP[T[VZWYXWXF RXFZE[CZAY@ RWAVBTCPANBMC",
"G]LFLWMYNZP[T[VZWYXWXFZE[CZAY@ RWAVBTCPANBMC",
"H[VMV[ RMMMXNZP[S[UZVY RVMXLYJXHWG RWHVITJPHNIMJ",
"G]LFLWMYNZP[T[VZWYXWXF RXFZE[CZAY@ RRbSaR`QaRbR`", /* U+1EF0 U_CAP HORN */
"G]LFLWMYNZP[T[VZWYXWXFZE[CZAY@ RRbSaR`QaRbR`", /* U+1EF0 U_CAP HORN */
"H[VMV[ RMMMXNZP[S[UZVY RVMXLYJXHWG RRbSaR`QaRbR`",
"I[RQR[ RKFRQYF RP>SA",
"JZMMR[ RWMR[P`OaMb RPESH",
@ -9300,7 +9300,7 @@ const char* const newstroke_font[] =
"E_I[V[VK RN[NK[K",
"E_JKZK RJSRKZSR[JS",
"E_Z[J[ RZSR[JSRKZS", /* U+2390 *OPEN_H */
"E_JKZK RJSRKZSR[JS RJSZS",
"E_JKZK RJSRKZSR[JSZS",
"E_Z[J[ RZSR[JSRKZS RJSZS",
"E_JVLV RJPZP RQVSV RXVZV",
"BbL[FQLGXG^QX[L[",

View File

@ -10,8 +10,7 @@ from typing import Any, NamedTuple
import re
import sys
# fontconv.awk only performed duplicate removal within a source glyph
global_duplicate_point_removal = False
global_duplicate_point_removal = True
input_fonts = ['symbol', 'font', 'hiragana',
'katakana', 'half_full', 'CJK_symbol',