jpgraph 한글 사용법 > PHP

STUDY ROOM

PHP

jpgraph 한글 사용법

페이지 정보

작성자 JMStudy 작성일08-11-12 17:11 조회11,949회 댓글0건

본문

1.include/Jpgraph/TTF 디렉토리 생성



2.NGULIM.TTF 를 복사해 넣는다.



3.htdocs/Jpgraph/jpgraph.php 편집



3-1 아래 코드를 추가한다.

DEFINE("TTF_DIR","/적당한디렉토리/TTF/");
DEFINE("FF_NGULIM", 18);


3-2
class TTF 를 찾아 $this->$font_files 배열에

FF_NGULIM => array(FS_NORMAL=>'NGULIM.TTF', FS_BOLD=>'NGULIM.TTF',FS_ITALIC=>'NGULIM.TTF', FS_BOLDITALIC=>'NGULIM.TTF' ),


3-3 한글처리를 위해 iconv사용하게 소스를 수정한다.
Text클래스의 Text메소드 와 Set메소드

// Create new text at absolute pixel coordinates
function Text($aTxt="",$aXAbsPos=0,$aYAbsPos=0) {
if( ! is_string($aTxt) ) {
JpGraphError::Raise('First argument to Text::Text() must be s atring.');
}
$this->t = iconv("EUC-KR" , "UTF-8" , $aTxt);
$this->x = round($aXAbsPos);
$this->y = round($aYAbsPos);
$this->margin = 0;
}

function Set($aTxt) {
$this->t = iconv("EUC-KR" , "UTF-8" , $aTxt);
}
Axis클래스의 SetTickLabels 메소드

function SetTickLabels($aLabelArray,$aLabelColorArray=null) {
for($i=0;$i $aLabelArray[$i] = iconv("EUC-KR","UTF-8",$aLabelArray[$i]);
}
$this->ticks_label = $aLabelArray;
$this->ticks_label_colors = $aLabelColorArray;
}
Plot클래스의 SetLegend메소드

function SetLegend($aLegend,$aCSIM="",$aCSIMAlt="") {
$this->legend = iconv("EUC-KR","UTF-8",$aLegend);
$this->legendcsimtarget = $aCSIM;
$this->legendcsimalt = $aCSIMAlt;
}


를 추가해 넣는다.

댓글목록

등록된 댓글이 없습니다.