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/[email protected]/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개

오 감사합니다~!
감사합니다^^
유용한정보 감사합니다^^
좋은정보 감사합니다.
좋은 정보 감사합니다 !
감사합니다
댓글을 작성하시려면 로그인이 필요합니다.
+
제목 글쓴이 날짜 조회
21-04-04 조회 6,782
21-04-03 조회 7,463
21-04-01 조회 7,475
21-03-27 조회 8,026
21-03-16 조회 7,262
21-03-16 조회 7,839
21-03-15 조회 9,143
21-03-10 조회 6,021
21-03-09 조회 8,574
21-03-09 조회 9,419
21-03-08 조회 6,992
21-03-08 조회 9,860
21-03-07 조회 6,275
21-03-05 조회 6,959
21-03-04 조회 9,007
21-02-26 조회 7,040
21-02-24 조회 6,163
21-02-20 조회 9,508
21-02-16 조회 8,575
21-02-16 조회 6,582
21-02-14 조회 1.6만
21-02-11 조회 8,006
21-02-03 조회 6,637
21-02-01 조회 6,775
21-01-31 조회 8,669
21-01-30 조회 6,211
21-01-29 조회 7,559
21-01-29 조회 7,091
21-01-28 조회 7,547
21-01-28 조회 9,987