<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ekastrya</title>
    <description>The latest articles on DEV Community by ekastrya (@ekastrya).</description>
    <link>https://dev.to/ekastrya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F422861%2Fe47e6ad7-76e5-4233-bc8c-f9d76f7c5d7f.png</url>
      <title>DEV Community: ekastrya</title>
      <link>https://dev.to/ekastrya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ekastrya"/>
    <language>en</language>
    <item>
      <title>How to Add Fonts to TCPDF in Your Project</title>
      <dc:creator>ekastrya</dc:creator>
      <pubDate>Fri, 03 Jul 2020 08:49:26 +0000</pubDate>
      <link>https://dev.to/ekastrya/how-to-add-fonts-to-tcpdf-in-your-project-1177</link>
      <guid>https://dev.to/ekastrya/how-to-add-fonts-to-tcpdf-in-your-project-1177</guid>
      <description>&lt;p&gt;(Versi Bahasa Indonesia: &lt;a href="https://medium.com/@ekastrya/cara-menambah-font-untuk-tcpdf-17af6808b76"&gt;https://medium.com/@ekastrya/cara-menambah-font-untuk-tcpdf-17af6808b76&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Earlier today, I was assigned a simple task to add two custom fonts for a client's project. It took me 15 minutes on Stack Overflow to find a fast way to do this. Found it and here are the steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install / download / require the tcpdf library into your project.&lt;/li&gt;
&lt;li&gt;Open the library folder (for example mine was: ./vendor/tecnickcom/tcpdf).&lt;/li&gt;
&lt;li&gt;Notice and enter to the tools folder.&lt;/li&gt;
&lt;li&gt;Copy the TTF file(s) into this tools folder.&lt;/li&gt;
&lt;li&gt;Run this command from the terminal (still from the tools folder):
&lt;code&gt;$ php tcpdf_addfont -i BOOKOS.TTF&lt;/code&gt;
(Replace BOOKOS.TTF with your own fonts)&lt;/li&gt;
&lt;li&gt;Repeat step (5) for each fonts desired.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Coding time..&lt;br&gt;
To change between fonts from your php code, use the following  scripts.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$pdf-&amp;gt;SetFont($font_family = ‘bookos’, $variant = ‘’, $fontsize = 11);&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;(Versi Bahasa Indonesia: &lt;a href="https://medium.com/@ekastrya/cara-menambah-font-untuk-tcpdf-17af6808b76"&gt;https://medium.com/@ekastrya/cara-menambah-font-untuk-tcpdf-17af6808b76&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>php</category>
      <category>tcpdf</category>
      <category>fonts</category>
    </item>
  </channel>
</rss>
