Giter Site home page Giter Site logo

font-pack-demo's Introduction

font-pack-demo

字体压缩Demo

背景

  • 线上部署包体积大,字体库达到 10M
  • 需要针对字体库进行压缩,减小打包后体积

实践

参考网上压缩字体的方法

font-spider(字蛛)---前端压缩字体

然而并没有达到期望目标,附上效果图:

20210615145637

分析

font-spider 适合做压缩文本固定不变的html页面,只能压缩页面上出现的文字,而当页面上有出现了新的文字,但之前并未经过压缩,那么这个文字就会呈现默认字体样式,并不会带上压缩后的字体样式。总之,font-spider 不能做到 动态渲染页面 文字。

网上新的解决方案

font-spider-plus

font-spider-plus 支持动态渲染页面文字,但该方案适配兼容性个人感觉不是很好,所以未尝试。

font-pack-demo's People

Contributors

whf605319646 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.