The way this is achieved is by splitting up the metering and creation steps for text nodes, so if I can combine the current node with the previous one on the line, I will modify the previous node and not create a new one.
combine_nodes also now doesn't merge nodes with different tags, because otherwise we could swallow custom user tags.
This also fixes richtext.characters() when used with combined nodes that contain whitespaces (since it ignored kerning, it would previously swallow whitespaces and merge words). I now measure the text up to and including the character to determine where each character is positioned.
Fixes #35
The way this is achieved is by splitting up the metering and creation steps for text nodes, so if I can combine the current node with the previous one on the line, I will modify the previous node and not create a new one.
combine_nodes also now doesn't merge nodes with different tags, because otherwise we could swallow custom user tags.
This also fixes richtext.characters() when used with combined nodes that contain whitespaces (since it ignored kerning, it would previously swallow whitespaces and merge words). I now measure the text up to and including the character to determine where each character is positioned.