npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

snail-font

v1.9.4

Published

snailreader hybrid page font family improve

Downloads

22

Readme

蜗牛字体显示优化组件

组件功能

  • renderFonts 从网络加载视觉要求的汉仪旗黑500和600字重的字体作为中文普通及粗体字体,而安卓设备还会从网路加载视觉要求的Avenir550和650字重的字体作为英文及数字普通及粗体字体,从而达到视觉要求的页面字体显示效果。
  • renderAlphabetFonts 使用视觉要求的英文及数字字体Avenir来渲染页面,与renderFonts不建议同时使用

使用方法

npm i snail-font --save
import renderFonts from 'snail-font'
renderFonts() //在页面初始化阶段调用本方法即可
renderAlphabetFonts() //同上

注意事项

  • 蜗牛客户端目前使用的是UIWebView,在iOS12版本中存在缓存问题,导致每次加载页面都会重新下载字体造成页面打开缓慢,所以在iOS12版本的客户端内暂时禁用
  • renderAlphabetFonts方法与renderFonts方法不建议同时使用
  • renderAlphabetFonts方法由于所依赖的字体文件较小,所以在iOS12的蜗牛客户端内依然生效
  • 如果遇到某些安卓机型由于此字体设置导致文字无法垂直居中,可以将需要垂直居中的元素设置为font-family: serif来将指定元素的字体回退到默认字体; 已知机型:Android5.1的魅族,Android8.0的荣耀等