Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit f3b1a16

Browse files
author
steven.roulleau
committed
fix(Editor): missing fonts for CJK
MSIS-3270
1 parent 396a0ef commit f3b1a16

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Editor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ export class Editor {
362362
this.localTheme = ''
363363

364364
this.theme = theme
365+
this._setThemeFontFamily()
365366
this.penStyle = penStyle
366367
this.penStyleClasses = ''
367368

@@ -551,6 +552,7 @@ export class Editor {
551552
this.innerRecognizer.close(this.recognizerContext, this.model)
552553
.then((model) => {
553554
logger.info('Recognizer closed')
555+
this._setThemeFontFamily()
554556
initialize(InkModel.clearModel(model), true)
555557
handleSuccess(this, model)
556558
})
@@ -977,6 +979,15 @@ export class Editor {
977979
return null
978980
}
979981

982+
/**
983+
* Apply the font-family on theem corresponding to chosen language
984+
* @private
985+
*/
986+
_setThemeFontFamily () {
987+
const defaultLang = !Object.keys(Constants.Languages).includes(this.configuration.recognitionParams.iink.lang)
988+
this.theme['.text']['font-family'] = defaultLang ? Constants.Languages.default : Constants.Languages[this.configuration.recognitionParams.iink.lang]
989+
}
990+
980991
/**
981992
* Trigger the change callbacks (and by default send a change event).
982993
*/

0 commit comments

Comments
 (0)