dompdf does not display Georgia font

Asked

Viewed 146 times

1

I want to display a file with the font-family Georgia, already downloaded and put in the fonts folder of your lib, but I am searching and does not display in Georgia format. I’d like some help from you.

style

body{
    font-family:Georgia;
    font-size:14px;
    color:#555;
    line-height:20px;
}

As Displays no formato correto o 5.1 não estariam alinhados

If you were with the Georgia source, the 5.1 would not be aligned, correct?

  • 2

    In the browser displays?

  • 1

    Can make available the source you are using, I can test here

  • 1

    Face if you want to reference a font that is in the folder you have to use @font-face to index the font in the document and only then it will be available in the font-family... Since Georgia is native to Windows, I did a test here and it worked perfectly

  • hugocsl I even did this, but I was putting the whole file in bold. @font-face { font-family: "Georgia"; font-Weight: normal; font-style: normal; font-Variant: normal; src: url("'.$url.'/dompdf/lib/fonts/Georgia.ttf") format("truetype"); }

  • Where it’s in bold font-weight: normal; in the CSS

  • @sam http://sistema.ferreiraeborzone.com.br/feb-homologacao/dompdf/lib/fonts/Georgia.ttf

Show 1 more comment

1 answer

1


Buddy, how I fix this, maybe it’ll help you

1) I look for an equivalent when the source is paid, Georgia is registered by Microsoft, for example, but this free is very similar: https://fonts.google.com/specimen/Neuton

2) Configure it and:

<style>
@import url('https://fonts.googleapis.com/css?family=Neuton:400,700&display=swap');
body {
font-family: 'Neuton', serif;
}
</style>

If you still want to resolve via Library, this link can be useful: https://github.com/dompdf/dompdf/issues/1627

  • 2

    Gee, I had read that the source was registered by microsoft, but I thought I could pull the Dompdf.

  • I think it might work, but there you need to be very attentive to the specifications of the library and it always gives problem... take a look at this, it might also help you: https://github.com/dompdf/dompdf/issues/1627 ; I always need to work with custom fonts and look for a different solution for each case made me solve everything with similar (when appropriate in the project)

  • I added this link to the answer, it might be useful; since my answer fits more for question about custom fonts in general. Good luck!

  • I used your example Leonardo, but it didn’t work. I don’t know where I’m going wrong!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.