보통 위지윅 에디터를 쓸 경우 <font size=1>이 문제가 많지 않습니까? 요즘 크로스브라우징 때문에 IE/FF 지원하는 모듈을 찾고 있는데 제일 쓰고 싶은것은 네이버의 스마트에디터인데 네이버에 아는 사람이 없어서 패쑤~ 그 다음에 쓰고 싶은것은 이노바 무시기인데 이것은 유료구요. 희안하게 비슷한것을 만드는 놈들이 다 짜고 치는지 돈을 받더군요 ㅡㅡ;
setFocus(); selectRange(); if (para=="") edit.execCommand(command) else edit.execCommand(command, false, arguments[1]); Editor.focus(); if (RangeType != "Control") edit.select();
} function doSelectC(str,el) { var Index = el.selectedIndex; if (Index != 0) { el.selectedIndex = 0;
execCommand(str,el.options[Index].text); } } function doSelectCl(str,el) { var Index = el.selectedIndex; if (Index != 0) { el.selectedIndex = 0;
execCommand(str,"<"+el.options[Index].value+">");
} } function fnInit(){ for (i=0; i<document.all.length; i++) document.all(i).unselectable = "off"; // getSystemFonts(); } function getSystemFonts() { var a=dlgHelper.fonts.count; var fArray = new Array(); var oOption = document.createElement("OPTION"); oOption.text = "자본"; oOption.value = "0"; selectFontName.add(oOption); for (i = 1;i < dlgHelper.fonts.count;i++) { fArray[i] = dlgHelper.fonts(i); var oOption = document.createElement("OPTION");
oOption.text = fArray[i]; oOption.Value = i; selectFontName.add(oOption); } } /* **************************************** Created by Bound0 (bound0@tom.com) http://bbs.blueidea.com/viewthread.php?tid=2661868 **************************************** */ function formatfor(va) { var t=va.replace(/\r/g,''); t = t.replace(/(<(script|textarea|xmp|pre|style).*?>)([^\r]*?)(<\/\2>)/img, function (){return arguments[1]+arguments[3].replace(/\n/g, "\r")+arguments[4]}) t = t.replace(/\n/g, ""); return t } function fontsize(el) {var Index=el.selectedIndex var addpre="<font size="+el.options[Index].value+">" if(Index>7)addpre="<font style='font-size:"+el.options[Index].value+"pt'>" var oSel = Editor.document.selection.createRange() var sBookmark = oSel.getBookmark() var oSelhtml=oSel.htmlText if(oSelhtml!="") { var conts=oSelhtml var textLength = Editor.document.body.innerText.length oSel.moveStart("character", -1*textLength) var contp=formatfor(oSel.htmlText) var conta=formatfor(Editor.document.body.innerHTML) var contpa='' var partC="" var partB="" var partA="" var m=0 m=conta.indexOf(contp.substr(0,3)) var f=contp.length for(;f>0;f--) {if(conta.substr(m,f)==contp.substr(0, f)){contpa=contp.substr(0,f);partC=conta.substr(m+f);break}} var ko=contp.substr(f) var kol=ko.length var ty=conta.substr(m+f,kol) var hu="" for(var b=1;b<kol;b++)if(ko.substr(b)==ty.substr(0,kol-b)){hu=ko.substr(b);contpa+=hu;partC=partC.substr(kol-b);break} var k=contpa.length cont=conts.replace(/\n/g, "") var u=cont.length if(cont==contpa.substr(k-u)){partB=cont;partA=contpa.substr(0,k-u)}else{ for(u=cont.length;u>0;u--) {if(cont.lastIndexOf(contpa.substr(k-u))!=-1){partB0=contpa.substr(k-u);partA0=contpa.substr(0,k-u);break}} contt=formatfor(conts) if(hu!="")if(contt.substr(contt.length-kol)==ko)contt=contt.substr(0,contt.length-kol)+hu u=contt.length var youm=contpa.lastIndexOf(contt) if(youm!=-1){partB=contt;partA=contpa.substr(0,youm);partC=contpa.substr(youm+u)+partC}else{ for(;u>0;u--){if(contt.lastIndexOf(contpa.substr(k-u))!=-1){partB1=contpa.substr(k-u);partA1=contpa.substr(0,k-u);break}} if(partB1.length>partB0.length){partB=partB1;partA=partA1}else{partB=partB0;partA=partA0} } } if(partB.substr(partB.length-1)=="<"){partB=partB.substr(0,partB.length-1);partC="<"+partC} if(partB.substr(partB.length-2)=="</"){partB=partB.substr(0,partB.length-2);partC="</"+partC} var cook=[] partA=partA.replace(/(<(script|textarea|xmp|style).*?>)[\s\S]*?<\/\2>/ig, function (){co=cook.length cook[co]=arguments[0];return "<cook"+co+">"}) var ook="" partA=partA.replace(/(<(script|textarea|xmp|style).*?>)[\s\S]*?$/i, function (){co=cook.length ook=arguments[2] cook[co]=arguments[0];return "<cook"+co+">"}) if(ook!=""){fd="(^[\\s\\S]*?<\/"+ook+">)" jk=new RegExp(fd,["i"]) if(jk.test(partB)){jk.exec(partB) co=cook.length cook[co]=RegExp.$1 partB=partB.replace(jk,"<cook"+co+">")}} partB=partB.replace(/(<(script|textarea|xmp|style).*?>)[\s\S]*?<\/\2>/ig, function (){co=cook.length cook[co]=arguments[0];return "<cook"+co+">"}) ook="" partB=partB.replace(/(<(script|textarea|xmp|style).*?>)[\s\S]*?$/i, function (){co=cook.length ook=arguments[2] cook[co]=arguments[0];return "<cook"+co+">"}) if(ook!=""){fd="(^[\\s\\S]*?<\/"+ook+">)" jk=new RegExp(fd,["i"]) if(jk.test(partC)){jk.exec(partC) co=cook.length cook[co]=RegExp.$1 partC=partC.replace(jk,"<cook"+co+">")}} partC=partC.replace(/(<(script|textarea|xmp|style).*?>)[\s\S]*?<\/\2>/ig, function (){co=cook.length cook[co]=arguments[0];return "<cook"+co+">"}) var dol=[] var dos=[] var lon=[] fd="<FONT([^>]*?)>" jk=new RegExp(fd,["im"]) while(jk.test(partB)){ce=dol.length jk.exec(partB) dol[ce]=RegExp.$1 partB=partB.replace(jk,"<site"+ce+">") } ce=dol.length-1 for(;ce>-1;ce--) {kjc="<site"+ce+">" fd=kjc+'(.*?)<\/font>' jk=new RegExp(fd,["im"]) if(jk.test(partB)){dos[dos.length]=ce jk.exec(partB) ko3=kjc+RegExp.$1+"</site"+ce+">" partB=partB.replace(jk,ko3) }else{lon[lon.length]=ce} } partB=partB.replace(/<\/font>/img,"<lonf>") for(var c=dos.length-1;c>-1;c--) { uts=dol[dos[c]] if(""==(uts.replace(/size=[0-7+]+/i,"").replace(/style=("|')FONT-SIZE: [0-9.]+.*;*("|')/im,"").replace(/[\s\n\r]+/mg,""))){partB=partB.replace("<site"+dos[c]+">","") partB=partB.replace("</site"+dos[c]+">","")}else{partB=partB.replace("<site"+dos[c]+">","<font"+uts.replace(/ size=[0-7+]+/im,"").replace(/FONT-SIZE: [0-9.]+pt/im,"").replace(/ style=("|');*("|')/im,"")+">") partB=partB.replace("</site"+dos[c]+">","</font>")} } var addend="" var mio=[] partB=partB.replace(/<([^<> ]*?) [^<>]*?style=[^<>]*?FONT-SIZE: [0-9.]+[^<>]*?>/img, function (){notv="|select|input|option|object|" if(notv.indexOf("|"+arguments[1].toLowerCase()+"|")==-1){ op=mio.length mio[op]=arguments[0] return "<opis"+op+">"}else{return arguments[0]}}) kba=["h1","h2","h3","h4","h5","h6","pre","button","listing","big","small","tt","code","kbd","samp","td","\/td","caption","\/caption","th","\/th","tr","\/tr","table","\/table","thead","\/thead","tbody","\/tbody","tfoot","\/tfoot"] for(b in kba){ fd="<("+kba[b]+")[^<>]*?>" jk=new RegExp(fd,["img"]) partB=partB.replace(jk, function (){op=mio.length mio[op]=arguments[0] return "<opis"+op+">"}) } liming=[] partB=partB.replace(/<(opis|site|lonf)([0-9]*)>/g, function(){var op=liming.length if(arguments[1]=="opis"){liming[op]=mio[parseInt(arguments[2])]} if(arguments[1]=="site"){liming[op]="<font"+dol[parseInt(arguments[2])]+">"} if(arguments[1]=="lonf"){liming[op]="</font>"} return "<duan"+op+">" }) if(liming.length>0){ partB=partB.replace(/^(.+?)(<duan0>)/m,function(){if(""!=arguments[1]){return addpre+arguments[1]+"</font>"+arguments[2]} else{return arguments[0]}}) var op=liming.length-1 for(var kc=0;kc<op;kc++){ fd="(<duan"+kc+">)(.+?)(<duan"+(kc+1)+">)" jk=new RegExp(fd,["m"]) partB=partB.replace(jk, function(){if(""!=arguments[2]){return arguments[1]+addpre+arguments[2]+"</font>"+arguments[3]} else{return arguments[0]}})} fd="(<duan"+op+">)(.+?)$" jk=new RegExp(fd,["m"]) partB=partB.replace(jk,function(){if(""!=arguments[2]){return arguments[1]+addpre+arguments[2]+"</font>"} else{return arguments[0]}}) } else{partB=addpre+partB+"</font>" } partB=partB.replace(/<duan([0-9]+)>/g,function(){return liming[parseInt(arguments[1])]}) var endtemp=partA+partB+partC for(vof in cook)endtemp=endtemp.replace("<cook"+vof+">",cook[vof]) Editor.document.body.innerHTML=endtemp var vrvd=Editor.document.selection.createRange() vrvd.moveToBookmark(sBookmark) vrvd.select() } else{ Editor.document.selection.createRange().pasteHTML(addpre+"</font>") }Editor.focus() el.blur() el.selectedIndex=0} start(); //--> </script> </body> </html>
<font size=1> 이외에 <font style="font-size:9pt"> 이렇게 태그를 넣어줍니다.
----------------------
굴림 폰트 대신에 Arial을 기본으로 해줍니다. 이때는 <font size=1>로 해도 한글은 그런대로 볼만합니다(?) 그런데 FF에서 보면 좀 뭐합니다 ㅡㅡ; (렌더링 기준이 틀린가 봅니다)