I've included OpenSans-Light.ttf in source. If I added either font-weight: lighter or font-weight: 200 it is not getting applied on PDF. Always the regular font style is getting applied.
Any solution/workaround would be much appreciated.
mPDF does not support multiple weights for a font face - just normal and bold
http://www.mpdf1.com/forum/discussion/1369/open-sans-problems-with-bold-font-weight/p1
One workaround is to use .light {font-family:Open Sans Light}
Here's an example of what you get:

Another solution, which gives the same result is to use font-faces like this:
@font-face {
font-family: 'Open Sans';
src: url("font/OpenSans-Regular.ttf");
-fs-pdf-font-embed: embed;
-fs-pdf-font-encoding: Identity-H;
}
@font-face {
font-family: 'Open Sans';
src: url("font/OpenSans-Light.ttf");
font-weight:200;
-fs-pdf-font-embed: embed;
-fs-pdf-font-encoding: Identity-H;
}
.normal{font-family:Open Sans;}
.lighter{font-family:Open Sans;font-weight:200}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With