string-display-width

1.0.1 • Public • Published

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"

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i string-display-width

    Weekly Downloads

    21

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    14.6 kB

    Total Files

    23

    Last publish

    Collaborators

    • kdong007