본문으로 건너뛰기

set-font-size

설명

글꼴 크기를 설정할 때 발생합니다

사용법

"set-font-size": ({ fontSize: string }) => boolean | void;

파라미터

set-font-size 이벤트의 callback은 다음 파라미터를 포함하는 객체를 받을 수 있습니다:

  • fontSize - 적용할 글꼴 크기
정보

내부 이벤트를 처리하려면 Event Bus 메서드를 사용할 수 있습니다

예제

// RichText 초기화
const editor = new richtext.Richtext("#root", {
// 구성 속성
});
// "set-font-size" 이벤트 구독
editor.api.on("set-font-size", (obj) => {
console.log(obj.fontSize);
console.log("The font size was changed");
});
// 새 글꼴 크기 적용
editor.api.exec("set-font-size", {
fontSize: "11px"
});

변경 로그: 이 이벤트는 v2.0에서 추가되었습니다