2017-01-19 3 views
0

TinyMCE에서 Bold를 선택할 때 현재 글꼴의 굵은 글꼴을 사용하는 대신 다른 글꼴을 사용하고 싶습니다. 어떻게 할 수 있습니까? 당신의 굵은 텍스트의 소스 코드를TinyMCE : 굵게를 선택하면 일반적인 굵은 체 스타일을 적용하는 대신 다른 글꼴을 사용하는 방법은 무엇입니까?

+1

하지

  // get the current editor var editor = tinyMce.activeEditor; // get the editor formatter var f = editor.formatter; define my custom format var f = editor.formatter; f.register('customBold', { inline: 'span', selector: 'span,p', styles: { fontWeight: 'bold',fontFamily: 'arial'.....your custom style }, }); editor.addCommand('customBold',function(){ editor.applyFormat(name) }); editor.addButton(customBtn, { tooltip: 'My custom bold', icon: 'bold', cmd: customBold }); don't forgot to add a custom btn in you tollbar.  
텍스트를 굵게. 다음은 사용자 정의 도구 모음 버튼을 추가하는 간단한 예입니다 : https://www.tinymce.com/docs/demo/custom-toolbar-button/ –

답변

0
은 ... 당신이 요청하는 것은 당신은 ... 굵은 버튼을 그냥 (bolds 텍스트를) 수행이 작업을 수행하는 사용자 정의 도구 모음 단추를 만들 필요가
0

봐, 그것은 당신의 작은 인스턴스의 설정에 따라

<strong>, <b>, <span style="*"> or else 

을 표시 할 수있다.

이것을 알면 편집기 스타일 시트에서 글꼴을 설정할 수 있어야합니다. 예를 들어

p strong{ 
    font-weight:400; 
    font-family: ...; 
}