i

스마트에디터2.9 글꼴추가 방법

https://sir.kr/g5_plugin/2284 플러그인 관련 입니다.

 

config.js

aAdditionalFontList 행에 배열로 추가해주세요.

[code]

(function($){
    $(document).ready(function() {
        $(".smarteditor2").each( function(index){
            var get_id = $(this).attr("id");

            if( !get_id || $(this).prop("nodeName") != 'TEXTAREA' ) return true;

            nhn.husky.EZCreator.createInIFrame({
                oAppRef: oEditors,
                elPlaceHolder: get_id,
                sSkinURI: g5_editor_url+"/SmartEditor2Skin.html",    
                htParams : {
                    bUseToolbar : true,                // 툴바 사용 여부 (true:사용/ false:사용하지 않음)
                    bUseVerticalResizer : true,        // 입력창 크기 조절바 사용 여부 (true:사용/ false:사용하지 않음)
                    bUseModeChanger : true,            // 모드 탭(Editor | HTML | TEXT) 사용 여부 (true:사용/ false:사용하지 않음)
                    bSkipXssFilter : true,
                    aAdditionalFontList : [['Independence_hall','독립기념관체'], ['Jeju_Myeongjo','제주명조'], ['Chosunilbo_myungjo','조선일보명조체']],        // 추가 글꼴 목록
                    fOnBeforeUnload : function(){
                        //alert("완료!");
                    }
                }, //boolean
                fOnAppLoad : function(){
                    //예제 코드
                    //oEditors.getById["ir1"].exec("PASTE_HTML", ["로딩이 완료된 후에 본문에 삽입되는 text입니다."]);
                },
                fCreator: "createSEditor2"
            });
        });
    });
})(jQuery);

[/code]

 

smarteditor2.9\css\ko_KR\smart_editor2.css

최상단에 넣어주시면 됩니다.

[code]

@font-face {
    font-family: 'Chosunilbo_myungjo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/Chosunilbo_myungjo.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

.... etc

[/code]

 

SmartEditor2Skin.html

35번줄 글꼴레이어 관련 주석자리에 넣어주시면 됩니다.

[code]

<li><button type="button"><span>조선일보명조체<span>(</span><em style="font-family:'조선일보명조체',Chosunilbo_myungjo;">가나다라</em><span>)</span></span></button></li>

[/code]

 

여기까지만 하면, 목록에는 폰트가 나타나도, 에디터에는 반영이 안되는 문제가 있습니다.

이때는 해당 테마의 CSS에 "smarteditor2.9\css\ko_KR\smart_editor2.css" 여기서 추가한 것과 같이 font-face를 추가해주시면 정상작동 합니다.

 

|

댓글 6개

오 감사합니다~!
감사합니다^^
유용한정보 감사합니다^^
좋은정보 감사합니다.
좋은 정보 감사합니다 !
감사합니다
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
4년 전 조회 1.3만
4년 전 조회 9,821
4년 전 조회 5,213
4년 전 조회 3,837
4년 전 조회 4,241
4년 전 조회 4,201
4년 전 조회 4,598
4년 전 조회 3,942
4년 전 조회 4,733
4년 전 조회 5,950
4년 전 조회 2,912
4년 전 조회 5,353
4년 전 조회 6,152
4년 전 조회 3,969
4년 전 조회 6,478
4년 전 조회 3,349
4년 전 조회 3,860
4년 전 조회 5,747
4년 전 조회 4,046
4년 전 조회 3,260
4년 전 조회 6,462
4년 전 조회 5,293
4년 전 조회 3,514
4년 전 조회 1.3만
4년 전 조회 4,939
5년 전 조회 3,664
5년 전 조회 3,884
5년 전 조회 5,518
5년 전 조회 3,162
5년 전 조회 4,463