We tried to reproduce the issue with missing underlines, but to no avail. Could you please try isolate it in a sample project and attach it to a support ticket?
Regarding your other question - you can get the length of the text using TxtFormatProvider as follows:
Note that this will count only characters and not images, tables, etc, also it could be slow with larger documents.
As a side note, the best practice is to put the data providers directly in the visual tree insted of in the resources - this way its data context will be properly updated on change.
Looking forward to your reply.
All the best,
the Telerik team