I too tried to play around with this for a long time, but never got the results I wanted. I asked Kovid about this a while ago in another post series on the base font and key map algorith, but Kovid didn't write the code (llasram did) for this stuff so he wasn't able to solve the issue:
https://www.mobileread.com/forums/sho...658#post533658