zoltan-dulac / css3FontConverter

A shell script that can use other command line tools to produce @font-face compatible fonts in all browsers. Works under Windows (using Cygwin), Mac OS X and Linux
http://www.useragentman.com/blog/2011/02/20/converting-font-face-fonts-quickly-in-any-os/
390 stars 62 forks source link

[Enhancement] Certain font name prefixes are missing (semi vs demi, extra-bold etc) #14

Open shehi opened 9 years ago

shehi commented 9 years ago

Hey @zoltan-dulac :

As I was working with certain fonts from Google WebFonts, I noticed you are missing certain font name prefixes when convertFonts.sh is determining the numeric value for font-weight CSS property.

As a basis, let's look at OpenSans fonts: https://github.com/google/fonts/tree/master/apache/opensans

As you can see, this font has SemiBold variants. Your blog at:

http://www.useragentman.com/blog/2013/09/20/better-web-typography-with-font-weight-autohinting-and-font-feature-settings/#comment-911845

does list only DemiBold with weight value of 600. I believe SemiBold also should be treated with the same value.

Additionally, your table in that blog-post also mentions ExtraBold with font-weight value 800. However when I converting OpenSans, I got following CSS output:

@font-face {
  font-family: 'OpenSans';
  src: url('public/fonts/opensans/OpenSans-ExtraBold.eot?') format('eot'),
       url('public/fonts/opensans/OpenSans-ExtraBold.woff2') format('woff2'),
       url('public/fonts/opensans/OpenSans-ExtraBold.woff') format('woff'),
       url('public/fonts/opensans/OpenSans-ExtraBold.ttf')  format('truetype');
  font-weight: 700;
  font-style: normal;
}

As you can see the font-weight value in the output is 700 instead of 800. Is this a bug?

That's it for the moment. Thanks a lot for such a wonderful tool! :)

shehi commented 6 years ago

Ping.