Skip to content

kdong007/string-display-width

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string-display-width

approximate string's display without actual rendering (based on PingFang SC right now)

install

npm install string-display-width --save
yarn add string-display-width

import

import stringDisplayWidth from "string-display-width";

api

stringDisplayWidth(str, fontSize, fontWeight)

  • str, the string your want to meausre
  • fontSize, the display font size
  • fontWeight, "regular"|"medium"|"semiBold", default "regular"

About

approximate string's display without actual rendering

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published