해결을 영원히 못하는건가..

http://minimonk.tistory.com/2185

- 중요한건 한글을 사용하니까 한글 font를 넣을 수 있어야 할텐데
  일단은 web hosting server가 그리 만만하지는 않은것 같다. 불편해 죽겠다.
  그리고 gd lib도 지원한다는데, 과연 되는지는 모르겠다. 쩝.



이걸 해결하기 위하여,
아래와 같이 작업이 되어야 한다.

1. Mantis디렉토리의 config_inc.php에 다음 내용을 추가 합나다..
$g_use_jpgraph   = ON;
$g_jpgraph_path  = '../jpgraph-1.20.5/src/';
$g_graph_font = 'malgun';

2. config_default_inc.php를 수정합니다.

$g_system_font_folder = 'C:/WINDOWS/fonts/';

3. Mantis디렉토리 밑에 core디렉토리에 있는 graph_api.php를 수정합니다. (문제는 이 파일이 없다!) 하지만 상관없다.

  $t_font_map = array(
   'arial' => FF_ARIAL,
   'verdana' => FF_VERDANA,
   'courier' => FF_COURIER,
   'book' => FF_BOOK,
   'comic' => FF_COMIC,
   'times' => FF_TIMES,
   'georgia' => FF_GEORGIA,
   'trebuche' => FF_TREBUCHE,
   'vera' => FF_VERA,
   'veramono' => FF_VERAMONO,
   'malgun' => FF_MALGUN,                     # 이줄을 추가합니다.
   'veraserif' => FF_VERASERIF );

4. 이제 jpgraph디렉토리밑에 src디렉토리에 있는 jpgraph.php를 수정합니다..

function TTF() {
...
    $this->font_files=array(
                ....

               FF_MALGUN =>  array(FS_NORMAL=>'malgun.ttf',  FS_BOLD=>'malgunbd.ttf',   FS_ITALIC=>'',   FS_BOLDITALIC=>'' ),  # 이줄을 추가합니다.
                ....

5. gd_image.inc.php도 수정합니다.

...

# japanese font 어쩌구 근처에 
DEFINE("FF_MALGUN",35);   # 이줄을 추가합니다.

...

$txt = $this->langconv->Convert($txt,$this->font_family);   # 이줄 바로 밑에..
$txt = mb_convert_encoding( $txt, "UTF-8", "auto");    # 이줄도 추가합니

문제는 그 다음에 나오는데,
config할때 malgun이 없기 때문에 어쨌거나 font를 가져올 때 억지로 끼워맞춰줘야 한다.
그 부분이 아래와 같다. MantisGraph/core 안에 graph_api.php 중에
graph_get_font() 하는 곳에서 맨 아래 보면 그냥 malgun으로 setting 해 버려야 한다.
안그러면 영원히 못가져옴.


혹시나 해서 

어디어디 수정되었는지

보자구


hieonn@Weeklymate:/var/www2/MT$ grep -r malgun * | grep -v Examples

config_inc.php:  $g_plugin_MantisGraph_font = 'malgun';

config_inc.php:  $g_graph_font='malgun';

plugins/jpgraph/src/jpgraph_ttf.inc.php:                FS_NORMAL =>'malgun.ttf',

plugins/jpgraph/src/jpgraph_ttf.inc.php:                FS_BOLD =>'malgunbd.ttf',

plugins/MantisGraph/core/graph_api.php: $t_font = plugin_config_get( 'font', 'malgun' );

plugins/MantisGraph/core/graph_api.php:                 'arial' => 'malgun.ttf',

plugins/MantisGraph/core/graph_api.php:                 'malgun' => 'malgun.ttf',

plugins/MantisGraph/core/graph_api.php:         $t_font = 'malgun.ttf';

plugins/MantisGraph/core/graph_api.php:         /* hieonn inserted in order to use malgun */

plugins/MantisGraph/core/graph_api.php:         $t_font = 'malgun';

plugins/MantisGraph/core/graph_api.php:                 'malgun' => FF_MALGUN,

tags:g_graph_font       config_inc.php  /^  $g_graph_font='malgun';$/;"   v

tags:g_plugin_MantisGraph_font  config_inc.php  /^  $g_plugin_MantisGraph_font = 'malgun';$/;"    v

tags:t_font     plugins/MantisGraph/core/graph_api.php  /^      $t_font = plugin_config_get( 'font', 'malgun' );$/;"      v


hieonn@Weeklymate:/var/www2/MT$ grep -r MALGUN * | grep -v Examples

plugins/jpgraph/src/jpgraph_ttf.inc.php:define("FF_MALGUN",35);

plugins/jpgraph/src/jpgraph_ttf.inc.php:            FF_MALGUN  =>   array(

plugins/MantisGraph/core/graph_api.php:                 'malgun' => FF_MALGUN,

tags:FF_MALGUN  plugins/jpgraph/src/jpgraph_ttf.inc.php /^define("FF_MALGUN",35);$/;"     d


이정도시 싶은데..



'PMS' 카테고리의 다른 글

Matis Gantt chart & GD 한글 쓰기  (1) 2011.07.26
JpGraph 다운로드  (0) 2011.07.26
Mantis 폰트 바꾸는 법  (0) 2011.07.23
Mantis Due date 시간 fix 작업중  (0) 2011.07.18
Mantis Due date Email notification - plug in  (0) 2011.07.17

설정

트랙백

댓글