Giter Site home page Giter Site logo

font-list's Introduction

介绍

本项目是基于rust开发的一款获取本地系统字体列表,并可以把本地字体转换为http地址的小服务

可以用来干啥😊😊

  • 1、搞一个PC程序获取本地字体实现字体切换功能
  • 2、把本服务的二进制文件作为一个小扩展,在网页中调用接口实现字体的切换🐋🐋🐋
  • 3、拿来玩啊👨‍⚖️👨‍⚖️👨‍⚖️👨‍⚖️👨‍⚖️

服务

端口号 3030

  • 运行 cargo run
  • 构建 cargo build --release
地址 说明 返回值
http://127.0.0.1:3030/fonts 获取系统字体列表 json
http://127.0.0.1:3030/font?path=C:\\WINDOWS\\FONTS\\MSYHL.TTC 字体文件转化成 web 地址 File

json返回值示例

[
  {
    "family_name": [
      {
        "font_family": "Microsoft YaHei",
        "language": "English",
        "style": "Regular"
      },
      {
        "font_family": "微软雅黑",
        "language": "Chinese",
        "style": "Regular"
      }
    ],
    "file_name": "MSYHL.TTC",
    "font_name": "微软雅黑 Light",
    "path": "C:\\WINDOWS\\FONTS\\MSYHL.TTC",
    "post_script": "微软雅黑 Light",
    "weight": 290
  }, {
    // ...
  }
]

font-list's People

Watchers

 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.