unicode-pixel-width
v1.1.1
Published
Calculate string pixel width for support to all Unicode characters
Downloads
7
Keywords
Readme
unicode-pixel-width
String pixel width measurement supporting all Unicode characters
Supported fonts:
- Arial
Usage
const pixelWidth = require('unicode-pixel-width');
pixelWidth('My text ...', { font: 'Arial', size: 13 }); // 56.55px
pixelWidth('0123456789', { font: 'Arial', size: 13 }); // 72.8px
pixelWidth('ؤإئبةتثجحخدذرزسشصضطظغؼؽؾؿـفقكلمنهوىي', { font: 'Arial', size: 13 }); // 269.62px
pixelWidth('😀😁😂😃😄😅😆😇😈', { font: 'Arial', size: 13 }); // 144px