Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

leonsans

> 编程语言
Open source

Leon Sans is a geometric sans-serif typeface made with code in 2019 by Jongmin Kim.

10.2K stars0 likes3 views
WebsiteGitHub

About

Leon Sans is a geometric sans-serif typeface made with code in 2019 by Jongmin Kim.

Leon Sans

Leon Sans is a geometric sans-serif typeface made with code in 2019 by Jongmin Kim. It allows to change font weight dynamically and to create custom animations, effects or shapes in the Canvas element of HTML5. He designed the font to celebrate his newborn baby Leon.

There are live examples at https://leon-kim.com/examples/

And website at https://leon-kim.com/

What is special?

The font is made with code, it has coordinate values of the drawing points for each glyph. With the coordinate values, you can create custom shapes, effects or animations.

  • Drawing animation

  • Weight change

  • Wave

  • Metaball

  • Plant

  • Colorful

  • Color pattern

Usage

Download the minified js file in dist folder and include it in your html.

xml
<script src="js/leon.js"></script>

Generate LeonSans and draw it in the Canvas element of HTML5.

…

For the drawing animation, include TweenMax (JS animation library) in your html.

xml
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js"></script>

And update all the drawing values from 0 to 1

javascript
let i, total = leon.drawing.length;
for (i = 0; i < total; i++) {
    TweenMax.fromTo(leon.drawing[i], 1.6, {
        value: 0
    }, {
        delay: i * 0.05,
        value: 1,
        ease: Power4.easeOut
    });
}

Option list

Name Type Description
text string The text that needs to be shown.
size integer The size of the text.
weight number The weight of the font: 1 - 900. [Default: 1]
color array The colors of each characters. [Default: ['#000000']]
colorful array The colors for colorful effect. [Default: ['#c5d73f', '#9d529c', '#49a9db', '#fec330', '#5eb96e', '#fc5356', '#f38f31']]
tracking integer The spacing between the characters of a block of text. [Default: 0]
leading integer The distance between each line of text. [Default: 0]
align string How the text content of the element is horizontally aligned: left, center, right. [Default: left]
pathGap number The gap between each coordinate of the points on a line of each character: 0 - 1. [Default: 0.5]
amplitude number The amplitude of the wave effect: 0 - 1. [Default: 0.5]
maxWidth number The width of the text sentence.
breakWord boolean Words break when reaching the end of a line. [Default: false]
fps number The FPS for the wave effect. [Default: 30]
isPath boolean true to get the coordinate values of the points on a line of each character. [Default: false]
isWave boolean true for the wave effect. [Default: false]

Properties

Name Type Description
lineWidth number The thickness of lines of the character.
scale number The scale of the character. scale is 1 when the font size is 500.
drawing array The drawing object values for each character. 0 is the beginning of the animation, 1 is the end of the animation state.
data array An object of the raw data for the text.
paths array The coordinate values of the points on a line of each character.
drawingPaths array The coordinate values of the points on a line of each character to draw the drawing animation in WebGL. It has 1px distance of each path.
wavePaths array The coordinate values of the points on a line for the wave effect.
rect Object The size of the text and its position: {x: x position, y: y position, w: width, h: height}.

Methods

Name Description
on() Add update event.
off() Remove update event.
position(x, y) Set the position of the text.
updateDrawingPaths() Update paths for drawing in WebGL (PIXI.js). It's very expensive, only call when it needs.
drawPixi(graphics) Draw text in WebGL with PIXI.js.
draw(ctx) Draw text in the Canvas element.
drawColorful(ctx) Draw the colorful effect.
wave(ctx, t) Draw the wave effect.
pattern(ctx, w, h) Draw rectangle shapes at each path point
grid(ctx) Draw grid for each type.
point(ctx) Draw circles at each drawing point and lines for each type.
box(ctx) Draw outline box for the text.
reset() Reset all the values.
dispose() Dispose.

Issues· 14 open

View all issuesOpen on GitHub
  • #39

    Join the Tech team

    Updated Nov 21, 2025
  • #33

    中文不能显示

    Updated Aug 26, 2021
  • #25

    Full example code

    Updated Feb 15, 2021
  • #37

    Change capital M to be above baseline

    Updated Jan 26, 2021
  • #36

    website is still on 1.5

    Updated Oct 1, 2020
  • #35

    Output to SVG

    Updated Jul 31, 2020
  • #34

    Add some simple Chinese characters...

    Updated Jul 28, 2020
  • #30

    NPM package?

    Updated Feb 7, 2020
  • #29

    Is this available for threejs?

    Updated Nov 29, 2019
  • #28

    Add character: ấ, ầ, ậ,....

    Updated Nov 3, 2019

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言