TCPDF 한글 폰트 추가

TCPDF 한글 폰트 추가
TCPDF 한글 폰트 설치
TCPDF 한글 폰트 변환
TCPDF 트루타입 폰트 추가
TCPDF 나눔고딕, 나눔고딕코딩 폰트 추가

1 사전 작업[ | ]

2 폰트추가도구 확인[ | ]

  • /usr/share/php/tcpdf/tools/ 폴더로 이동
  • tcpdf_addfont.php 있는지 확인
[root@zetawiki ~]# cd /usr/share/php/tcpdf/tools/
[root@zetawiki tools]# ll
total 12
-rw-rw-r-- 1 root root 2003 May 13  2014 convert_fonts_examples.txt
-rwxr-xr-x 1 root root 7449 Aug  6  2013 tcpdf_addfont.php

3 맑은고딕 추가[ | ]

[root@zetawiki tools]# ll /usr/share/fonts/MalgunGothic.ttf 
-rw-r--r-- 1 root root 3997212 Sep  7 09:22 /usr/share/fonts/MalgunGothic.ttf
[root@zetawiki tools]# php tcpdf_addfont.php -i /usr/share/fonts/MalgunGothic.ttf

>>> Converting fonts for TCPDF:
*** Output dir set to /usr/share/php/tcpdf/fonts/
+++ OK   : /usr/share/fonts/MalgunGothic.ttf added as malgungothic
>>> Process successfully completed!
[root@zetawiki tools]# ll /usr/share/php/tcpdf/fonts/ | grep malgun
-rw-r--r-- 1 root root   23383 Sep  9 13:21 malgungothic.ctg.z
-rw-r--r-- 1 root root  150183 Sep  9 13:21 malgungothic.php
-rw-r--r-- 1 root root 1559511 Sep  9 13:21 malgungothic.z
→ 폰트가 /usr/share/php/tcpdf/fonts/ 폴더에 추가됨
→ TCPDF에서 malgungothic 이라는 이름으로 폰트 사용 가능

4 나눔폰트 추가[ | ]

[root@zetawiki tools]# ls /usr/share/fonts/NanumFont/*
/usr/share/fonts/NanumFont/NanumBrush.ttf
/usr/share/fonts/NanumFont/NanumGothicBold.ttf
/usr/share/fonts/NanumFont/NanumGothicExtraBold.ttf
/usr/share/fonts/NanumFont/NanumGothic.ttf
/usr/share/fonts/NanumFont/NanumMyeongjoBold.ttf
/usr/share/fonts/NanumFont/NanumMyeongjoExtraBold.ttf
/usr/share/fonts/NanumFont/NanumMyeongjo.ttf
/usr/share/fonts/NanumFont/NanumPen.ttf
[root@zetawiki tools]# ls /usr/share/fonts/NanumFont/* | xargs -I TTF php tcpdf_addfont.php -i TTF

>>> Converting fonts for TCPDF:
*** Output dir set to /usr/share/php/tcpdf/fonts/
+++ OK   : /usr/share/fonts/NanumFont/NanumBrush.ttf added as nanumbrush
>>> Process successfully completed!
... (생략)

>>> Converting fonts for TCPDF:
*** Output dir set to /usr/share/php/tcpdf/fonts/
+++ OK   : /usr/share/fonts/NanumFont/NanumPen.ttf added as nanumpen
>>> Process successfully completed!
[root@zetawiki tools]# ll /usr/share/php/tcpdf/fonts/ | grep nanum
-rw-r--r-- 1 root root   38143 Sep  9 13:21 nanumbrush.ctg.z
-rw-r--r-- 1 root root  192465 Sep  9 13:21 nanumbrush.php
-rw-r--r-- 1 root root 1517240 Sep  9 13:21 nanumbrush.z
-rw-r--r-- 1 root root   38351 Sep  9 13:22 nanumgothicb.ctg.z
-rw-r--r-- 1 root root  193541 Sep  9 13:22 nanumgothicb.php
-rw-r--r-- 1 root root 2441869 Sep  9 13:21 nanumgothicb.z
-rw-r--r-- 1 root root   38351 Sep  9 13:22 nanumgothic.ctg.z
-rw-r--r-- 1 root root   38351 Sep  9 13:22 nanumgothicextrab.ctg.z
-rw-r--r-- 1 root root  193557 Sep  9 13:22 nanumgothicextrab.php
-rw-r--r-- 1 root root 2300377 Sep  9 13:22 nanumgothicextrab.z
-rw-r--r-- 1 root root  193532 Sep  9 13:22 nanumgothic.php
-rw-r--r-- 1 root root 2387929 Sep  9 13:22 nanumgothic.z
-rw-r--r-- 1 root root   23103 Sep  9 13:22 nanummyeongjob.ctg.z
-rw-r--r-- 1 root root  136475 Sep  9 13:22 nanummyeongjob.php
-rw-r--r-- 1 root root 1567017 Sep  9 13:22 nanummyeongjob.z
-rw-r--r-- 1 root root   23103 Sep  9 13:22 nanummyeongjo.ctg.z
-rw-r--r-- 1 root root   23088 Sep  9 13:22 nanummyeongjoextrab.ctg.z
-rw-r--r-- 1 root root  136489 Sep  9 13:22 nanummyeongjoextrab.php
-rw-r--r-- 1 root root 1921071 Sep  9 13:22 nanummyeongjoextrab.z
-rw-r--r-- 1 root root  136468 Sep  9 13:22 nanummyeongjo.php
-rw-r--r-- 1 root root 1353175 Sep  9 13:22 nanummyeongjo.z
-rw-r--r-- 1 root root   38143 Sep  9 13:22 nanumpen.ctg.z
-rw-r--r-- 1 root root  192460 Sep  9 13:22 nanumpen.php
-rw-r--r-- 1 root root 1456590 Sep  9 13:22 nanumpen.z
→ TCPDF에서 nanumbrush, nanumgothicb, nanumgothic, ..., nanumpen라는 이름으로 폰트 사용 가능

5 나눔고딕코딩 추가[ | ]

[root@zetawiki tools]# ls /usr/share/fonts/truetype/nanum-coding/*
/usr/share/fonts/truetype/nanum-coding/NanumGothic_Coding_Bold.ttf
/usr/share/fonts/truetype/nanum-coding/NanumGothic_Coding.ttf
[root@zetawiki tools]# ls /usr/share/fonts/truetype/nanum-coding/* | xargs -I TTF php tcpdf_addfont.php -i TTF

>>> Converting fonts for TCPDF:
*** Output dir set to /usr/share/php/tcpdf/fonts/
+++ OK   : /usr/share/fonts/truetype/nanum-coding/NanumGothic_Coding_Bold.ttf added as nanumgothic_coding_b
>>> Process successfully completed!


>>> Converting fonts for TCPDF:
*** Output dir set to /usr/share/php/tcpdf/fonts/
+++ OK   : /usr/share/fonts/truetype/nanum-coding/NanumGothic_Coding.ttf added as nanumgothic_coding
>>> Process successfully completed!
[root@zetawiki tools]# ll /usr/share/php/tcpdf/fonts/ | grep nanumgothic_coding
-rw-r--r-- 1 root root   23132 Sep  9 13:23 nanumgothic_coding_b.ctg.z
-rw-r--r-- 1 root root  149008 Sep  9 13:23 nanumgothic_coding_b.php
-rw-r--r-- 1 root root 1021317 Sep  9 13:23 nanumgothic_coding_b.z
-rw-r--r-- 1 root root   23132 Sep  9 13:23 nanumgothic_coding.ctg.z
-rw-r--r-- 1 root root  148998 Sep  9 13:23 nanumgothic_coding.php
-rw-r--r-- 1 root root 1000721 Sep  9 13:23 nanumgothic_coding.z
→ TCPDF에서 nanumgothic_coding, nanumgothic_coding_b라는 이름으로 폰트 사용 가능

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}