Public Repository

Last pushed: 5 months ago
Short Description
Extract small size font which you offer font.
Full Description

You able to use the image to run a web server if you need dynamic to get fonts.

It minify font's size when you don't need full fonts.

Run server

Run a server if you offer font file at remote server.

docker run -h 0.0.0.0 -p 5000:5000  peter1209/font-generator-server:0.0.1 http://your-ip/your-font.zip

Or use local font files, you could mount volume to /root/fonts.

docker run -h 0.0.0.0 -p 5000:5000  -v /root/fonts:/root/fonts/your-font-folder peter1209/font-generator-server:0.0.1

Parameters:

  • -font-url :Get a remote font zip to extract.
  • -processes:Set running processes. The default is 10.

Usage

When call web api, you will get css of embedding base64 font.

curl -X POST -H "Content-Type: application/json" -d '{"fontName":"newFontName", "text":"input text to extract fonts", "fontBase":"PHTK51.TTF"}' http://localhost:5000/fontGenerator/fonts/generate

API

POST /fontGenerator/fonts/generate

Extract some text by font.

Parameters:

  • fontName - specifiy a new font-family name.
  • text - extract font text.
  • fontBase - use font.

This project source code on github.

Docker Pull Command
Owner
peter1209

Comments (0)