getSp method

double getSp(
  1. double fontSize
)

仅支持纵屏。 returns the font size after adaptation according to the screen density. 返回根据屏幕宽适配后字体尺寸 fontSize 字体尺寸

Implementation

double getSp(double fontSize) {
  if (_screenDensity == 0.0) return fontSize;
  return fontSize * _screenWidth / _designW;
}