Git Product home page Git Product logo

Comments (4)

mccarlosen avatar mccarlosen commented on August 23, 2024 4

Change the custom_font_data settings to this:

'custom_font_data' => [
    'quantify' => [
        'R' => 'Quantify.ttf' // regular font
     ]
],

Within your view, remove the @font-face and change your font-family by this:

body {
    font-family: 'quantify', sans-serif;
    letter-spacing: 2px;
    padding-right: 0 !important;
}

For some reason the name of the font only accepts lowercase...'quantify' => [

I hope it has been helpful, ah and do not forget to refresh the cache...

In my example, just apply the font to the h1 tag.

body h1 {
    font-family: 'quantify', sans-serif;
}

image

from laravel-mpdf.

kinger251285 avatar kinger251285 commented on August 23, 2024 1

Brilliant, did the trick. Had to move the letter spacing to my table class too to work otherwise this was ignored but fully working now. Thanks for the great package and quick response.

from laravel-mpdf.

hannanstd avatar hannanstd commented on August 23, 2024

best package for persian characters. after alot of hours finaly this package helped me.
an note for arabic and persain fonts. if your characteres are seperately and not conneted use below config:

mpdf/mpdf#85 (comment)

from laravel-mpdf.

karunkshrestha avatar karunkshrestha commented on August 23, 2024

I am having the similar issue where the custom fonts are not picked up.
config:
image

fonts:
image

load view:
$pdf = PDF::loadView('emails.test.view',['data' => $this->data]);

Result: defaults to dejavu font
image

from laravel-mpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.