UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

20 lines (19 loc) 1.25 kB
import { MapCreator } from '../../../../../../../../common/utils/map-creator'; import { FontInfoCache } from '../../../../../../../../common/model/caches/hashed-caches/font-info-cache'; import { CharacterPropertyDescriptor } from '../../../../../../../../common/model/character/character-property-descriptor'; import { ElementDestination } from '../../../destination'; import { InnerDefaultRunPropertiesDestination } from './inner-default-run-properties-destination'; export class DefaultRunPropertiesDestination extends ElementDestination { static { this.handlerTable = new MapCreator() .add('rPr', (data) => new InnerDefaultRunPropertiesDestination(data, data.documentModel.defaultCharacterProperties)) .get(); } get elementHandlerTable() { return DefaultRunPropertiesDestination.handlerTable; } async processElementOpen(reader) { super.processElementOpen(reader); const properties = this.data.documentModel.defaultCharacterProperties; properties.setValue(CharacterPropertyDescriptor.size, 10); properties.setValue(CharacterPropertyDescriptor.fontInfo, this.data.documentModel.cache.fontInfoCache.getItemByName(FontInfoCache.fallbackFontName)); } }