Answers.Body: <p>Finally I loaded the fonts with the load_font.php script (dompdf/utils) and that's how it works.</p>
  <p>(See also: <a href="https://stackoverflow.com/a/18066618/10228942">https://stackoverflow.com/a/18066618/10228942</a>)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-13T12:54:19.707Z
Answers.Text: Are you able to expand on this answer at all? I downloaded load_font.php here: https://github.com/dompdf/utils/blob/master/load_font.php but am having trouble running it successfully. Not sure how to configure the following within load_font:
  
  // 1. [Required] Point to the composer or dompdf autoloader
  require_once "vendor/autoload.php";
Answers.UserDisplayName: Tchick
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-17T16:44:05.463Z
Answers.Text: @Tchick Have you read the linked answer? When you saved the load_font.php in the dompdf folder, you have to change the path to "../autoload.php"
Answers.UserDisplayName: Sanbo
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-18T17:26:20.830Z
Answers.Text: thank you for this - I got it working now (the path to autoload.php was incorrect as you suggest).
Answers.UserDisplayName: Tchick
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-19T18:32:48.643Z
Answers.Text: You're welcome!
Answers.UserDisplayName: Sanbo
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-01T11:29:53.387Z
Answers.LastActivityDate: 2022-09-01T12:40:49.963Z
Answers.LastEditDate: 2022-09-01T12:40:49.963Z
Answers.UserDisplayName: Sanbo
Body: <p>I want to render two custom fonts in my commerce pdf, but it does not work.</p>
  <p>I tried it in several ways: I use the @font-face and used the path as well the URL and also put the font files in different locations: in /web/assets/fonts, in /storage/fonts and directly in the dompdf/lib/fonts ... nothing works! And I used several fonts.</p>
  <p>Any idea? Many thanks in advance!</p>
  
Tags: <plugin-craftcommerce><dompdf>
Title: Custom fonts in pdf
ThreadText: # Custom fonts in pdf
  
  (Asked by: username_0 on 2022-08-31)
  
  I want to render two custom fonts in my commerce pdf, but it does not work.
  
  I tried it in several ways: I use the @font-face and used the path as well the URL and also put the font files in different locations: in /web/assets/fonts, in /storage/fonts and directly in the dompdf/lib/fonts ... nothing works! And I used several fonts.
  
  Any idea? Many thanks in advance!
  
  **Tags:** plugin-craftcommerce, dompdf
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-09-01. Score: 0 | Accepted answer
  
  Finally I loaded the fonts with the load\_font.php script (dompdf/utils) and that's how it works.
  
  (See also: <https://stackoverflow.com/a/18066618/10228942>)
  
  > **Comments:**
  > **username_1**: Are you able to expand on this answer at all? I downloaded load_font.php here: https://github.com/dompdf/utils/blob/master/load_font.php but am having trouble running it successfully. Not sure how to configure the following within load_font:  // 1. [Required] Point to the composer or dompdf autoloader require_once "vendor/autoload.php";  
  > **username_0**: @username_1 Have you read the linked answer? When you saved the load_font.php in the dompdf folder, you have to change the path to "../autoload.php"  
  > **username_1**: thank you for this - I got it working now (the path to autoload.php was incorrect as you suggest).  
  > **username_0**: You're welcome!  
  
  ---
  
  