From 052eeb5a18e2bc1043d27dbfb1cd29e8f5d39fb5 Mon Sep 17 00:00:00 2001
From: treeform <starplant@gmail.com>
Date: Fri, 1 Oct 2021 10:53:56 -0700
Subject: [PATCH] Fix tofu advance.

---
 src/pixie/fonts.nim                   |   5 +++--
 tests/fonts/diffs/tofu_advance.png    | Bin 0 -> 4790 bytes
 tests/fonts/masters/tofu_advance.png  | Bin 0 -> 2805 bytes
 tests/fonts/rendered/tofu_advance.png | Bin 0 -> 5728 bytes
 tests/test_fonts.nim                  |  10 ++++++++++
 5 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 tests/fonts/diffs/tofu_advance.png
 create mode 100644 tests/fonts/masters/tofu_advance.png
 create mode 100644 tests/fonts/rendered/tofu_advance.png

diff --git a/src/pixie/fonts.nim b/src/pixie/fonts.nim
index 648f964..0b42065 100644
--- a/src/pixie/fonts.nim
+++ b/src/pixie/fonts.nim
@@ -143,9 +143,10 @@ proc getGlyphPath*(
 
 proc getAdvance*(typeface: Typeface, rune: Rune): float32 {.inline, raises: [].} =
   ## The advance for the rune in pixels.
-  let typeface2 = typeface.fallbackTypeface(rune)
+  var typeface2 = typeface.fallbackTypeface(rune)
   if typeface2 == nil:
-    return
+    # Get tofu advance, see tofu_advance test.
+    typeface2 = typeface
 
   if typeface2.opentype != nil:
     result = typeface2.opentype.getAdvance(rune)
diff --git a/tests/fonts/diffs/tofu_advance.png b/tests/fonts/diffs/tofu_advance.png
new file mode 100644
index 0000000000000000000000000000000000000000..2b30fd23ec3e855a8213c2a59d46a6e66f67d590
GIT binary patch
literal 4790
zcmbtYXH-*NmkuPLlz>vC=^KzhMCrYwfRF%E0tkX2NbgNRIzfe3r3PZ?O+txMlqNlj
zA`ptwA=0EtM@s1M1=q}4^R1a5^UmD6);)Kf@|<Vyd(N}(KF<yHwZZh<^Z)<=jDTw*
z0RSK`<=y@~E#(<*WRd^?u!JErZ<#!%S{?T&cC_P+o|aNlQc8ZVC&-%gyj}C`YQCDE
z@;6c^{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q^=jTSr==oL)_BQ92f|3z`P&
z{M0avrgCV%JFg@y#?>>}SG$=OyaCTC>~7EfdLWFYxR=Q%#v9N9deueqtEq}j^&vMt
zH>u)#ND`&#B!+4FEN4HdO{}^PrsBaax1E`zSjBmh(h99^`_F{_!dZ2xMC4hX?;1y?
zNhy$SjJ%WrZD9vEgBsul{!J+ghW-pKz$9QEo*(&ul)X#o)7R<vKlJ&>@UIxpu)-Os
zcy_nA&j?wt(Ed|m|2FBt*F-4dob&mS$C2x2HWWmB{=XXhAGnvm2t~LCq3y{L;~#=-
z|J5n~HaCU-|Hhxv7c3r9@B~iu&hVCq|4)8@4rk_=DOih!5+HYFlYlcJ>D&A#->3V5
YWNoWg;)~pM%6Sw3aa&)rOx-5xU;Yp4&j0`b

literal 0
HcmV?d00001

diff --git a/tests/fonts/masters/tofu_advance.png b/tests/fonts/masters/tofu_advance.png
new file mode 100644
index 0000000000000000000000000000000000000000..adee2e33fd9fcaa460a16cff92659a2918d81864
GIT binary patch
literal 2805
zcmeHJ`!^fd7CtFzs$*(8*UV6_KHOH(R$EmfUQ>!HLlQ>3rbV?Pv`GmfYF_Q!*0UW!
z6>XQw5JZa*iO|ke2u<1|@yMfwG$q6%Lqt4odhZ``f4S?defB=zUhAB_&syKw-@m>M
zJZorRY5)K*^z%Iv0)UQ{HjevbyLQhGMigk>j;p@mH~@Bj@zEgQ{)4ZzAOsh3)(bRp
z&8D>n-2~6`o&Y>8*tvc|4*-MPerG%p>5w_mT+u&}d$zv|mv2ygfX_pp9IaVtqmMqv
zC+7^%t|lXh(Q_8gY1!^p4TFp?b5__1kdBIDgO&*$<8?Td`oq2E215Wm^s6x1w_HB=
z03auMvu)y`g?sk;^8}|9u~{?#3$@M;+ozfW0|VVwXE!%A<>PHBDFD2K<Kj^sn;R<0
zE4hH`<i5E&`TovP)<{<U7=J{>z#nvX|BawhRCL`~U6^=3+MKWlfK`Mc<bd%~KO%Q)
zUCC2&vbLQ$teQrh9G<)E$KRMHSKU<EoT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(Frsr<G%%?JuWN|YLe6mt;2!za#JA8*)K>q^`8
z2>Kq}<^MpJp$EzcO)&(!5OrfLiMQltthm02iWM%M45R558rY5|kouiDwweIF>{?@a
z>;d0^sQr#U``M=i!7xM<a@YBQtDI*@#rpZ~UKw1@A9~^72shCVev-w#Y&pN7*-kso
zn98D=asRodS(=v<V_<rEx@ll2S+2x9xr!YhO}2+qG17%3f{bu2=A3jI6X9pc`Au?S
zSxx(kks09}c#fSEVPlyeL||g=D&2^gEXDm;++<JQaQyhqA4YK}+juMYdo?y_QW?W1
zM6v$fc{JL5t2ULqqM8||D2Y-h9nd89+iZ5;?KpB8E6co6e@5}GtTBz$2XET4#k4(a
z37vAP*1M?ilWIaIEfN!j-%xfyu<K~o{=GE@m4ngy9rNS!R<6jx6VB5q=&t~fn<D}J
zSITaW|A>eB1ONd!l&Q<)i6~poYC}k;?G}8}KA+g_3P2>k^)oBDC^j=q-@x8nt2(%?
zb3bY&Pb4fX(^RWM-evw*p6D6@@Nf@A7l02w+Ur2a|Ka5S!JlmI65hXL8)2>?Yn3DL
N^A0@I==J@N{{{^?Gn4=T

literal 0
HcmV?d00001

diff --git a/tests/fonts/rendered/tofu_advance.png b/tests/fonts/rendered/tofu_advance.png
new file mode 100644
index 0000000000000000000000000000000000000000..a1deb57338b997cba10a5f5e60e4ec9500829731
GIT binary patch
literal 5728
zcmbuDXH-+&wuS?Ua3TmQMWZzR6e)sI1%%L1kWQ%51f(W_^cqBID$+saqe=}W6zLEY
zr6@}8RX|!o=rs_yE8g?x+&j(~XWaWId+&^~*Pe5(S)O-A>1e4jLSaw{1j6{>zOo(!
zLc<O2ZRt;g-(X#X7zl)o_kps4fiD$t@*ia^^Q_@B&r^buG)-8pszy=Aanq~Yik{My
zXjN8b;|Zldr+luL-&0ITr<R%d6wMt$9`5W~)$2Da9#F+WsG(P1XtLR{p9)JQY2~`^
zFo>oEG)blfYy@HQo)FSkmsbl(&2lHx3CZc{>6|p+`yuo>j+ZEgK+bW8P%e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V3U(
zs6+_mdWR;~D7O`y0$7+!fp;MGY}EAN64JpePkB@hhfqx97CA-fRFF8H5X$9$p35mg
zDAqAw`txe+iAiuA+pE^c2X=Opzkj>_=kNae&vFm{aS28lSKjX(DOPYB{hw|8^POLG
zqTs+s^UnbM=|@@d7u|p0-@msJgiTNs(vkJiSdguA#-6gGeDeR#MzCZeL!IC)5YMLv
zqLgrQ^ZkD}h~mJe9Ob~Zi{(!^^8zUZ3Guu9ucxj5vaA2g>l3Ql@v(t<>R~wL-3KaK
K%B6}{q5lPrM80PL

literal 0
HcmV?d00001

diff --git a/tests/test_fonts.nim b/tests/test_fonts.nim
index c54150d..6b78f7c 100644
--- a/tests/test_fonts.nim
+++ b/tests/test_fonts.nim
@@ -1091,3 +1091,13 @@ block:
   image.fillText(font, "Grumpy ウィザード make 有毒な醸造 for the 悪い女王 and Jack.")
 
   doDiff(image, "fallback2")
+
+block:
+  var font = readFont("tests/fonts/Inter-Regular.ttf")
+
+  font.size = 26
+  let image = newImage(800, 100)
+  image.fill(rgba(255, 255, 255, 255))
+  image.fillText(font, "This[]Advance!")
+
+  doDiff(image, "tofu_advance")