Update Letter-Spacing Implementation in Konva
Adam-Greenan opened this issue · 0 comments
Overview
We discovered a discrepancy between Konva's Text letter-spacing implementation and standard CSS letter-spacing while developing our application. After investigating the Konva code, we identified that a polyfill is being used, likely to address Safari's historical lack of support for letter-spacing.
Current Behavior
Konva currently uses a custom polyfill for letter-spacing.
For RTL text direction, native CSS letter-spacing is used.
Observations
Based on our testing, modern versions of Safari now support letter-spacing correctly. If this is confirmed, it may be beneficial to phase out the polyfill in favor of the native implementation across all cases. This would simplify the codebase and align behavior with CSS standards.
We also found that even when using RTL for the direction of Konva Text, we still could not achieve the exact same letter spacing as regular css does.
Feedback on Commit 7d5ba3e (Version 9.3.8)
We’ve been using Konva version 9.3.8, and the changes in commit 7d5ba3e ("rename fix apply") resolved some vertical alignment issues for us. After several months of testing, we’ve found the fix to be stable and effective.