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 type. With the coordinate values, you can create custom shapes, effects or animations.
Usage
Download the minified js file in dist folder and include it in your html.
<script src="js/leon.js">script>
Generate LeonSans and draw it in the Canvas element of HTML5.
this.canvas = document.createElement('canvas'); document.body.appendChild(this.canvas); this.ctx = this.canvas.getContext("2d"); this.leon = new LeonSans({ text: 'The quick brownnfox jumps overnthe lazy dog', color: ['#000000'], size: 160, weight: 200 }); requestAnimationFrame(animate); function animate(t) { requestAnimationFrame(animate); this.ctx.clearRect(0, 0, document.body.clientWidth, document.body.clientHeight); const x = (document.body.clientWidth - this.leon.rect.w) / 2; const y = (document.body.clientHeight - this.leon.rect.h) / 2; this.leon.position(x, y); this.leon.draw(this.ctx); }
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. |
destroy() |
Destroy. |
87 comments
Your blog never ceases to amaze me, it is very well written and organized.”~’;-
I am now not certain where you are getting your information, but good topic.
I must spend some time studying much more or understanding more.
Thanks for great information I was searching for this info for my mission.
Oh my goodness! Incredible article dude! Many thanks, However I am having difficulties
with your RSS. I don’t understand the reason why I cannot join it.
Is there anybody else having similar RSS issues?
Anyone that knows the answer can you kindly respond? Thanks!!
Way cool! Some extremely valid points! I appreciate you writing this post and also the rest of the website is extremely good.
It’s going to be finish of mine day, but before ending I am reading this impressive
paragraph to increase my experience.
I was very happy to uncover this web site. I want to to thank you
for your time for this fantastic read!! I definitely loved every little bit of it and i also have you book marked to
look at new information in your site.
This page truly has all the information I wanted concerning
this subject and didn’t know who to ask.
Appreciating the commitment you put into your website
and in depth information you provide. It’s awesome to come across a blog every once in a
while that isn’t the same out of date rehashed information. Excellent read!
I’ve saved your site and I’m adding your RSS feeds to my
Google account.
Hi, I would like to subscribe for this website to take most recent updates, thus
where can i do it please help.
Woah! I’m really enjoying the template/theme of this blog.
It’s simple, yet effective. A lot of times it’s very hard
to get that “perfect balance” between usability and visual appeal.
I must say that you’ve done a amazing job with this.
Also, the blog loads extremely fast for me on Opera.
Exceptional Blog!
What’s up, its nice paragraph about media print, we all be aware of media is a great source of
data.
You actually make it seem really easy with your presentation however
I in finding this matter to be actually something that I feel I would by no means understand.
It kind of feels too complex and extremely large for me.
I am taking a look ahead to your subsequent post, I will try to get the cling of
it!
I am really enjoying the theme/design of your site.
Do you ever run into any internet browser compatibility issues?
A few of my blog readers have complained about my website not operating correctly in Explorer
but looks great in Opera. Do you have any suggestions
to help fix this issue?
Actually no matter if someone doesn’t know then its up to other people that they
will help, so here it takes place.
hi!,I really like your writing very so much!
share we keep in touch more about your post on AOL?
I need a specialist on this space to unravel my problem.
May be that’s you! Having a look forward to peer you.
Aw, this was an exceptionally nice post. Finding the time and actual effort to create a very good article… but what can I say… I hesitate a lot and don’t seem to get anything done.
Touche. Sound arguments. Keep up the amazing
spirit.
I’m gone to tell my little brother, that he should also pay a visit
this weblog on regular basis to take updated from latest
news update.
For the reason that the admin of this web site is working, no doubt very
rapidly it will be well-known, due to its quality contents.
I am genuinely grateful to the holder of this
site who has shared this wonderful article at at this
time.
Its like you learn my mind! You seem to know so much about this, like you wrote the guide in it or something.
I feel that you simply can do with a few % to pressure the message home a little bit,
but instead of that, this is great blog. A great read.
I will definitely be back.
Do you have a spam problem on this website; I also am a blogger, and I was wondering your situation;
many of us have developed some nice practices and we are looking to trade techniques with other folks,
please shoot me an e-mail if interested.
Greate article. Keep writing such kind of information on your site.
Im really impressed by your blog.
Hi there, You’ve done a great job. I will certainly digg it and
for my part recommend to my friends. I am sure they will be benefited
from this site.
Thanks for finally talking about > Leon Sans – Pavvy Designs < Loved it!
This site was… how do I say it? Relevant!! Finally I have found something which helped me.
Appreciate it!
I’m not sure exactly why but this site is loading very slow for
me. Is anyone else having this issue or is it a problem on my end?
I’ll check back later on and see if the problem still exists.
Whoa! This blog looks exactly like my old one! It’s on a totally different subject but it has pretty much the same page layout and design. Wonderful
choice of colors!
I know this website offers quality dependent articles and other stuff, is there any other site which offers these kinds of things in quality?
Hey! I could have sworn I’ve been to this website before
but after browsing through some of the post I realized it’s new to
me. Nonetheless, I’m definitely happy I found it and I’ll be bookmarking and checking back frequently!
It’s remarkable to go to see this site and reading the views of all friends about this piece of
writing, while I am also eager of getting knowledge.
Hi my friend! I wish to say that this article is awesome, nice written and come with approximately all important
infos. I would like to peer more posts like this .
bookmarked!!, I really like your web site!
Can I simply just say what a comfort to uncover a person that actually understands
what they are discussing over the internet.
You definitely realize how to bring a problem
to light and make it important. More and more people need to read this and understand
this side of your story. I was surprised that you are not more popular since you
surely possess the gift.
Hello there! Do you use Twitter? I’d like to follow
you if that would be okay. I’m definitely enjoying your blog and look forward to new posts.
You ought to take part in a contest for one of the highest quality blogs on the web.
I most certainly will highly recommend this site!
My spouse and I stumbled over here by a different
web page and thought I might check things out. I like what I see so now i’m following you.
Look forward to looking at your web page yet again.
Pretty section of content. I just stumbled upon your site and in accession capital to assert that I get in fact enjoyed account
your blog posts. Anyway I’ll be subscribing to your augment and even I achievement you access consistently quickly.
I don’t even know the way I finished up here, however
I thought this publish used to be good. I do not know who you’re
however certainly you are going to a famous blogger should you aren’t already.
Cheers!
Hello, constantly i used to check website posts here
in the early hours in the dawn, since i love to learn more and more.
Truly when someone doesn’t know after that its up to other viewers that they will help, so here it takes place.
Hey just wanted to give you a quick heads up and let you know a few of the images aren’t loading
correctly. I’m not sure why but I think its a linking issue.
I’ve tried it in two different internet browsers
and both show the same results.
Hello There. I found your blog using msn. This is an extremely well written article.
I will make sure to bookmark it and return to read more of your
useful info. Thanks for the post. I’ll certainly comeback.
Great blog here! Also your website loads up fast! What host are
you using? Can I get your affiliate link
to your host? I wish my site loaded up as quickly as yours lol
I know this web page provides quality dependent articles or reviews and extra
stuff, is there any other website which provides such information in quality?
Keep on working, great job!
Hey! Quick question that’s completely off topic.
Do you know how to make your site mobile friendly?
My weblog looks weird when browsing from my apple iphone.
I’m trying to find a template or plugin that might be able to resolve this problem.
If you have any suggestions, please share. Thank you!
You are so cool! I don’t suppose I’ve truly read through
something like this before. So nice to discover someone with
original thoughts on this subject. Really.. thank you for starting this up.
This site is one thing that is needed on the internet, someone with some originality!
Fantastic goods from you, man. I have understand your stuff previous to and you’re
just extremely great. I actually like what you have acquired here, really like what you are
stating and the way in which you say it. You make it enjoyable and you still care for to keep it
wise. I can’t wait to read far more from you.
This is really a great website.
I visited various websites but the audio quality for audio songs present at this
site is genuinely excellent.
You really make it appear really easy together with your presentation but I in finding this
topic to be really one thing which I believe I might by no means understand.
It kind of feels too complex and very large
for me. I am having a look forward on your next submit, I’ll attempt to get the dangle of
it!
It’s going to be end of mine day, but before finish I am reading this wonderful article to increase my experience.
It’s very effortless to find out any matter on net as compared to textbooks, as
I found this piece of writing at this web site.
Today, I went to the beachfront with my kids.
I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She
put the shell to her ear and screamed. There was a hermit crab inside and
it pinched her ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!
It’s hard to come by educated people about this topic,
but you sound like you know what you’re talking about! Thanks
Hi! I realize this is sort of off-topic however I
needed to ask. Does managing a well-established blog such as yours require a large amount of
work? I’m completely new to blogging however I do write in my diary everyday.
I’d like to start a blog so I can share my own experience and thoughts online.
Please let me know if you have any kind of suggestions or tips for
brand new aspiring blog owners. Appreciate it!
I am really loving the theme/design of your site.
Do you ever run into any browser compatibility issues?
A number of my blog readers have complained about my site not working correctly
in Explorer but looks great in Firefox. Do you have any ideas
to help fix this issue?
Excellent blog you have here but I was wanting to know if you knew of any message boards that cover the same topics discussed in this article?
I’d really love to be a part of online community where I
can get suggestions from other experienced individuals that share
the same interest. If you have any suggestions, please let me know.
Thanks a lot!
Hi there, I would like to subscribe for this website to get
newest updates, thus where can i do it please help.
I have been surfing on-line greater than 3 hours as of late, but I
never found any fascinating article like yours.
It is pretty price enough for me. In my opinion, if all site owners and bloggers made excellent content
as you probably did, the web will likely be much more helpful than ever before.
Hi there, I believe your web site might be having browser compatibility
problems. When I look at your site in Safari, it looks fine
however, when opening in I.E., it has some overlapping issues.
I just wanted to provide you with a quick heads up!
Apart from that, wonderful website!
Wonderful beat ! I wish to apprentice while you amend
your site, how can i subscribe for a blog website? The account aided me a appropriate deal.
I have been tiny bit acquainted of this your broadcast provided brilliant
clear idea
I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you?
Plz answer back as I’m looking to construct my own blog and would like to
find out where u got this from. kudos
I absolutely love your blog.. Pleasant colors & theme.
Did you make this site yourself? Please reply back as I’m planning to create my very own website and want to know where you got this from or exactly what
the theme is called. Thanks!
Hi there, I enjoy reading all of your article.
I wanted to write a little comment to support you.
Thanks very nice blog!
I am truly grateful to the holder of this web site who has shared this great
paragraph at at this time.
whoah this weblog is magnificent i really like reading your posts.
Stay up the great work! You understand, many individuals are searching
round for this info, you could help them
greatly.
Hello There. I found your blog the usage of msn. That is a really well written article.
I will be sure to bookmark it and come back to read more of your helpful information. Thank you for
the post. I will definitely comeback.
After I originally commented I appear to have clicked the -Notify
me when new comments are added- checkbox and from now on every time a comment is added I receive 4 emails with the same comment.
Is there a way you can remove me from that service? Thanks!
Amazing blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would
really make my blog shine. Please let me know
where you got your design. Thank you
Great goods from you, man. I’ve remember your stuff prior to and you’re simply extremely fantastic.
I really like what you’ve received right here, really like what you
are saying and the best way in which you are saying it.
You are making it entertaining and you still take care of to
keep it sensible. I can not wait to read much
more from you. That is really a terrific site.
I blog frequently and I genuinely thank you for your information. Your article has really peaked my interest.
I’m going to bookmark your blog and keep checking
for new information about once per week. I subscribed to your Feed too.
It’s hard to come by well-informed people on this topic, but you sound
like you know what you’re talking about! Thanks
This post will assist the internet visitors for building up new web site or even a blog
from start to end.
Way cool! Some very valid points! I appreciate you writing this post plus the rest of the website is extremely good.
Do you have any video of that? I’d want to find out
some additional information.
Your mode of describing the whole thing in this article is actually pleasant,
every one can effortlessly be aware of it, Thanks a lot.
Greate post. Keep writing such kind of information on your blog.
Im really impressed by your blog.
Hi there, You’ve done an excellent job. I’ll definitely digg it and in my view suggest to my friends.
I am confident they will be benefited from this site.
What’s up colleagues, fastidious post and good urging
commented at this place, I am really enjoying by these.
I just could not go away your website prior to suggesting
that I extremely enjoyed the usual information an individual
provide to your visitors? Is going to be again continuously in order to inspect new posts
Terrific post however I was wanting to know if you could write
a litte more on this subject? I’d be very thankful if you could elaborate a little bit more.
Cheers!
Excellent article. I certainly love this site. Stick with it!
Its such as you learn my thoughts! You seem to know a lot about this, like you wrote the e-book in it or something.
I think that you just could do with a few % to drive the message house a
bit, however other than that, this is wonderful blog.
An excellent read. I’ll certainly be back.
Terrific work! That is the type of information that are supposed to
be shared across the net. Disgrace on the seek engines for no longer positioning this publish higher!
Come on over and consult with my web site . Thank you =)
My page poker pulsa online
Excellent blog you have got here.. It’s difficult to find good quality writing like yours these days.
I seriously appreciate individuals like you! Take care!!
If you are going for most excellent contents like myself, simply pay a visit this web site
everyday since it presents quality contents, thanks
Today, I went to the beach front with mmy children. I found a sea
shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.
There was a hermit crab inside and itt pinched her ear.
She never wants to go back! LoL I know this
is completely off topic but I hadd to tell someone!
Also visit my page: nude models