How Apple create alphabetic in Pencil kit Demo ?

Hi , I was watching https://developer.apple.com/videos/play/wwdc2020/10148/

And I did read the demo project code but I don't understand how Apple know when write "W" in textfield it's "W" in drawing area ?

I understand that we separate every char from drawing data , but how it matching with the textfield text ?

this part it's confusing me

How Apple create alphabetic in Pencil kit Demo ?
 
 
Q