i

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

· 2021-03-08 (월) 19:29:45 · 8699 · 6

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개

오 감사합니다~!
2021-03-25 (목) 09:03:39
감사합니다^^
2022-04-26 (화) 14:37:54
유용한정보 감사합니다^^
2023-02-11 (토) 02:01:44
좋은정보 감사합니다.
2024-04-22 (월) 19:08:03
좋은 정보 감사합니다 !
2025-02-26 (수) 18:34:56
감사합니다
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
21-04-01 조회 6,150
21-03-27 조회 6,818
21-03-16 조회 6,003
21-03-16 조회 6,709
21-03-15 조회 8,014
21-03-10 조회 4,891
21-03-09 조회 7,410
21-03-09 조회 8,269
21-03-08 조회 5,875
21-03-08 조회 8,700
21-03-07 조회 5,198
21-03-05 조회 5,831
21-03-04 조회 7,922
21-02-26 조회 5,914
21-02-24 조회 5,074
21-02-20 조회 8,390
21-02-16 조회 7,444
21-02-16 조회 5,434
21-02-14 조회 1.5만
21-02-11 조회 6,885
21-02-03 조회 5,518
21-02-01 조회 5,703
21-01-31 조회 7,583
21-01-30 조회 5,097
21-01-29 조회 6,433
21-01-29 조회 5,992
21-01-28 조회 6,431
21-01-28 조회 8,843
21-01-26 조회 4,865
21-01-26 조회 6,889