New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

unicode-pixel-width

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unicode-pixel-width

Calculate string pixel width for support to all Unicode characters

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
4
100%
Maintainers
6
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 26 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts