인터넷정보

본문 내용 글씨를 폰트 크기, 지정폰트, 축소, 확대 하기

알 수 없는 사용자 2007. 10. 18. 14:15

이미지 파일은 업로드 파일 다운받으세요.


<style>
@font-face {font-family:웹정; src:url(http://oxtag.com/zboard/jung10.mwf);}
body,td {font-size:10pt;font-family:웹정;}
</style>

<font color=ffcc00>글자가 잘 안보이시는 분은 설정을 조절해서 보세요.☞ </font>
<span onMousedown="jericho_layer('fontface','visible')" style=cursor:hand><img src="font_font.gif" border="0" align="absmiddle"></span>
<span onMousedown="jericho_layer('fontcolor','visible')" style=cursor:hand><img src="font_color.gif" border="0" align="absmiddle"></span>
<a href="javascript:PlusFont();"><img src="font_plus.gif" border="0" align="absmiddle"></a>
<a href="javascript:MinusFont();"><img src="font_minus.gif" border="0" align="absmiddle"></a>
<a href="javascript:SetArticleFont();"><img src="font_save.gif" border="0" align="absmiddle"></a>
<a href="javascript:SetDefaultFont();"><img src="font_default.gif" border="0" align="absmiddle"></a>



<div id=article>
도움말 참고하세요..^^
<br />

<br />
*스킨이 아닙니다..
</div>

<script>
var Font;
var fontsize;
var fontface;
var LineHeight = 18;
var fontcolor;

temp = GetArticleFont("ArticleFont").split("//");

if (temp != "") {
        if(temp[0] == "") {
                fontsize = 10;
                fontface = "웹정";
                fontcolor = "#A7A7A7"
        } else {
        fontsize = parseInt(temp[0]);
        fontface = temp[1];
                if (fontsize > 10) {
                        LineHeight = 18 + (fontsize-10);;                        
                } else {
                        LineHeight = 18;
                }
        fontcolor = temp[2]
        }
                       
} else {
        fontsize = 10;
        fontface = "웹정";
        fontcolor = "#A7A7A7";
}
article.style.fontSize = fontsize +"pt";
article.style.fontFamily = fontface;
article.style.color = fontcolor;
article.style.lineHeight = LineHeight + "pt";

function SetDefaultFont() {
        var todayDate = new Date();
        var name = "ArticleFont";
        var expiredays = -1;
        var value = article.style.fontSize + "//" + article.style.fontFamily + "//" +         article.style.color;
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + value + "; path=/; expires=" + todayDate.toGMTString() + ";"
        document.location.reload();
        alert("웹정, 10pt, #A7A7A7 로 변경했습니다.");
}
               
function SetArticleFont() {
        var todayDate = new Date();
        var name = "ArticleFont";
        var expiredays = 365;
        var value = article.style.fontSize + "//" + article.style.fontFamily + "//" +         article.style.color;
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + value + "; path=/; expires=" + todayDate.toGMTString() + ";"
        alert(""+article.style.fontFamily+", "+article.style.fontSize+", "+article.style.color+" 로 저장했습니다");
}

function GetArticleFont(name){
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                        endOfCookie = document.cookie.length;
                        return document.cookie.substring( y, endOfCookie );
                }
                               
                x = document.cookie.indexOf( " ", x ) + 1;
                               
                if ( x == 0 ) break;
        }
                        return "";
}

function PlusFont() {
        if (fontsize <= 19) {
        article.style.fontSize = (fontsize + 2) +"pt";
        article.style.lineHeight = LineHeight + 2 + "pt";
        fontsize = fontsize + 2;
        LineHeight = LineHeight + 1;
        }
}

function MinusFont() {        
        if (fontsize >= 7) {
        article.style.fontSize = (fontsize - 2) +"pt";
        article.style.lineHeight = LineHeight - 2 + "pt";
        fontsize = fontsize - 2;
        LineHeight = LineHeight - 1;
        }
}
               
function FontCase(Font) {
        article.style.fontFamily = Font;
}

function FontColor(Font) {
        article.style.color = Font;
}

function SetFont() {
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + 365 );
        document.cookie = "Font = " + article.style.fontSize + "; path=/; expires=" + todayDate.toGMTString() + ";"                        
}

var select_obj;
function jericho_layer(name,status) {
        var obj=document.all[name];
        var _tmpx,_tmpy, marginx, marginy;
        _tmpx = event.clientX + parseInt(obj.offsetWidth);
        _tmpy = event.clientY + parseInt(obj.offsetHeight);
        _marginx = document.body.clientWidth - _tmpx;
        _marginy = document.body.clientHeight - _tmpy ;
        if(_marginx < 0)
                _tmpx = event.clientX + document.body.scrollLeft + _marginx ;
        else
                _tmpx = event.clientX + document.body.scrollLeft ;
        if(_marginy < 0)
                _tmpy = event.clientY + document.body.scrollTop + _marginy +20;
        else
                _tmpy = event.clientY + document.body.scrollTop ;
        obj.style.posLeft=_tmpx-13;
        obj.style.posTop=_tmpy-12;
        if(status=='visible') {
                if(select_obj) {
                        select_obj.style.visibility='hidden';
                        select_obj=null;
                }
                select_obj=obj;
        }else{
                select_obj=null;
        }
        obj.style.visibility=status;
}

function jericho_layer_print(mode) {
        var printHeight = 0;
        var printMain="";
        if (mode == 'fontface')        {
                printMain = "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('굴림');><td style=color:white;font-family:굴림;font-size:9pt height=18 nowrap> 굴림  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('바탕');><td style=color:white;font-family:바탕;font-size:9pt height=18 nowrap> 바탕  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('돋움');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 돋움  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('궁서');><td style=color:white;font-family:궁서;font-size:9pt height=18 nowrap> 궁서  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('Arial');><td style=color:white;font-family:Arial;font-size:9pt height=18 nowrap> Arial  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('Tahoma');><td style=color:white;font-family:Tahoma;font-size:9pt height=18 nowrap> Tahoma  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#444444' onMouseOut=this.style.backgroundColor='' onMousedown=FontCase('Verdana');><td style=color:white;font-family:Verdana;font-size:9pt height=18 nowrap> Verdana  </td></tr>";
                printHeight = printHeight + 16;
        }

        if (mode == 'fontcolor')        {
                printMain = "<tr onMouseOver=this.style.backgroundColor='#ffce00' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#ffce00');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 진노랑  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#ED1C24' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#ED1C24');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 적색  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#63ce00' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#63ce00');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 녹색  </td></tr>";
                printHeight = printHeight + 16;
               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#808000' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#808000');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 올리브  </td></tr>";
                printHeight = printHeight + 16;
               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#448CCB' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#448CCB');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 연한 파랑  </td></tr>";
                printHeight = printHeight + 16;
               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#A186BE' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#A186BE');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 연한 보라  </td></tr>";
                printHeight = printHeight + 16;
                               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#03D5D5' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#03D5D5');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 연한 청록  </td></tr>";
                printHeight = printHeight + 16;
                               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#808080' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#808080');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 회색  </td></tr>";
                printHeight = printHeight + 16;
                               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#C0C0C0' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#C0C0C0');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 은색  </td></tr>";
                printHeight = printHeight + 16;
                               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#A59996' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#A59996');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 황갈색  </td></tr>";
                printHeight = printHeight + 16;
                               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#658E3B' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#658E3B');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 연한녹색  </td></tr>";
                printHeight = printHeight + 16;
                               
                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#B4BDC0' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#B4BDC0');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 블루그레이  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#C69C6D' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#C69C6D');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 황토  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#FF00FF' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#FF00FF');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 밝은 자홍  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#F06EAA' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#F06EAA');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 연한 분홍  </td></tr>";
                printHeight = printHeight + 16;

                printMain = printMain + "<tr onMouseOver=this.style.backgroundColor='#FFFFFF' onMouseOut=this.style.backgroundColor='' onMousedown=FontColor('#FFFFFF');><td style=color:white;font-family:돋움;font-size:9pt height=18 nowrap> 흰색  </td></tr>";
                printHeight = printHeight + 16;


        }

        var printHeader = "<div id='"+mode+"' style='position:absolute; left:10px; top:25px; width:127; height: "+printHeight+"; z-index:1; visibility: hidden' onMousedown=jericho_layer('"+mode+"','hidden')><table border=0><tr><td colspan=3 onMouseover=jericho_layer('"+mode+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=jericho_layer('"+mode+"','hidden') rowspan=2> </td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='black' width=100% height=100%><tr><td valign=top bgcolor=353535><table border=0 cellspacing=0 cellpadding=3 width=100% height=100%>";
        var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=jericho_layer('"+mode+"','hidden')> </td></tr><tr><td colspan=3 height=10 onMouseover=jericho_layer('"+mode+"','hidden')></td></tr></table></div>";

        document.writeln(printHeader+printMain+printFooter);
}

</script>
<script>
        jericho_layer_print('fontface');
        jericho_layer_print('fontcolor');
</script>

반응형