title: Laravel add add font in dompdf
body: <p>Please, give me answer, how i can add external font in dompdf load view :) 
  This is my structure `</p>
  
  <p>Fonts folder exists in storage/fonts/ and fonts are exists in 
  vendor/dompdf/dompdf/lib/fonts/
  And this is my code `</p>
  
  <p>This is my controller </p>
  
  <pre><code>public function generatePdf($data)
  {
      $data = Profile::find($data);
  
      $pdf = App::make('dompdf.wrapper');
      $pdf-&gt;setOptions(['fontDir' =&gt; storage_path('fonts/'), 'defaultFont' =&gt; 
      'OpenSansCondensedBold, OpenSans']);
  
      if ($data-&gt;graph_type == 'vertical') {
          $pdf-&gt;loadView('pdf.view', compact('data'));
      } else {
          $pdf-&gt;loadView('pdf.view', compact('data'))-&gt;setPaper('a4', 
          'landscape')-&gt;setWarnings(false)-&gt;output();
      }
      return $pdf-&gt;download();
  }
  </code></pre>
  
  <p>View `
  text in   tag is my css code for pdf view 
  and text in  tag is my html tag </p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;style&gt;
          h3{
              //font-family: "OpenSansCondensedBold";
              color: #7c5337;
              font-size: 18px;
              line-height: 18px;
              margin: 30px 0 0 0;
              padding: 0;
          }
  
          span{
              //font-family: "OpenSans";
              color: #484444;
              font-size: 14px;
              line-height: 14px;
              margin: 14px 0 0 0;
              padding: 0;
          }
          h2{
              //font-family: "OpenSans";
              color: #484444;
              font-size: 30px;
              line-height: 21px;
              padding: 0;
          }
          small{
              color: #7c5337;
              font-size: 14px;
              margin: 0 0 5px 0;
          }
  
          .left-block{
              float: left;
              padding-top: 200px;
              margin-left: 5%;
          }
  
          .left-block .image-block img{
              max-width: 173px;
              max-height: 526px;
          }
          .right-block {
              float: right;
              width: 40%;
              margin-left: 6%;
          }
  
  
          .topSection{
              width:80%;
              margin:  0 auto;
              text-align: center;
          }
          .info-block {
              padding:30px;
              margin-top: 20px;
              border: 1px solid #775035;
              border-radius: 10px;
              height: 560px;
              text-align: left;
          }
          .tiknesWidth li{
              color: #775035;
              text-decoration: none;
              list-style: none;
              display: inline-block;
          }
  
  
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="left-block"&gt;
          &lt;div class="image-block"&gt;
              &lt;?php if (is_null($data-&gt;file_pdf) || empty($data-&gt;file_pdf)) { 
              ?&gt;
                  &lt;img class="ak-image-responsive" src="
                  {{url('/user/images/not-image.png')}}"&gt;
              &lt;?php } else { ?&gt;
                  &lt;img class="ak-image-responsive" src="
                  {{asset('/storage/product/pdf/'.$data-&gt;file_pdf)}}" &gt;
              &lt;?php } ?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="right-block"&gt;
          &lt;div class="topSection"&gt;
              &lt;img src="{{url('/user/images/site-logo.png')}}"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
              &lt;div class="text-block"&gt;
                  &lt;small&gt;9407 Brown Lane #2&lt;/small&gt;&lt;br&gt;
                  &lt;small&gt;Austin, Texas 78754&lt;/small&gt;&lt;br&gt;
                  &lt;small&gt;P: 512-836-8990 office&lt;/small&gt;&lt;br&gt;
                  &lt;small&gt;F: 512-836-9796 fax&lt;/small&gt;&lt;br&gt;
                  &lt;small&gt;sales.office@finelumber.com&lt;/small&gt;&lt;br&gt;
                  &lt;small&gt;www.finelumber.com&lt;/small&gt;&lt;br&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="info-block"&gt;
              &lt;h3&gt;PROFILE NAME&lt;/h3&gt;
              &lt;h2&gt;{{$data-&gt;profile_name}}&lt;/h2&gt;
              &lt;ul class="tiknesWidth"&gt;
                  &lt;li style="margin-left: -40px;"&gt;
                      &lt;h3&gt;THICKNESS&lt;/h3&gt;
                      &lt;span style="margin-left: -40px;"&gt;{{(($data-
                      &gt;dimensions_first &gt; 0) ? $data-&gt;dimensions_first : '' ) 
                      . (($data-&gt;dimensions_first == 0 || $data-
                      &gt;dimensions_sub_first == 0) ? '' : '-') . (($data-
                      &gt;dimensions_sub_first &gt; 0 ) ? $data-
                        &gt;dimensions_sub_first : '')}}&lt;/span&gt;
                  &lt;/li&gt;
                  &lt;li style="margin-left: 50px;"&gt;
                      &lt;h3&gt;WIDTH&lt;/h3&gt;
                      &lt;span&gt;{{(($data-&gt;dimensions_second &gt; 0) ? $data-
                      &gt;dimensions_second : '') .(($data-&gt;dimensions_second == 
                      0 || $data-&gt;dimensions_sub_second == 0) ? '' : '-'). 
                      (($data-&gt;dimensions_sub_second &gt; 0) ? $data-
                      &gt;dimensions_sub_second : '')}}&lt;/span&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
              &lt;h3&gt;SPECIES IN STOCK&lt;/h3&gt;
              &lt;span&gt;
                      @if ($data-&gt;stock)
                      @foreach($data-&gt;stock as $key =&gt; $stock)
                          @if (count($data-&gt;stock) == $key + 1)
                              {{$stock-&gt;name}}
                          @else
                              {{$stock-&gt;name.','}}
                          @endif
                      @endforeach
                  @endif
              &lt;/span&gt;
              &lt;h3&gt;CATEGORY&lt;/h3&gt;
              &lt;span&gt;{{$data-&gt;category-&gt;name}}&lt;/span&gt;
              &lt;h3&gt;Fine Lumber ID&lt;/h3&gt;
              &lt;span&gt;{{$data-&gt;lumber_id}}&lt;/span&gt;
              &lt;h3&gt;Fine Lumber Location&lt;/h3&gt;
              &lt;span&gt;{{$data-&gt;lumber_location}}&lt;/span&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>