@@ -395,6 +395,98 @@ The following interfaces are involved:
395395 cancelFilterRender (viewId: string, isSync?: boolean): void ;
396396 ` ` `
397397 
398+ 6. ExtrasOption Custom Tool Configuration
399+ - Custom Pen Styles
400+ - Dotted Stroke Style
401+ ` ` ` ts
402+ export type DottedOpt = {
403+ /** Line cap style for dotted line, square: square cap, round: round cap, default value is round */
404+ lineCap : "square " | "round ";
405+ /** Dotted line, single segment length, default value is 1, i.e., single segment length is 1 */
406+ segment : number ;
407+ /** Dotted line, single segment gap, default value is 2, i.e., single segment gap is 2 * thickness */
408+ gap : number ;
409+ };
410+ /** Dotted stroke style */
411+ dottedStroke: {
412+ lineCap: " round" ,
413+ segment: 1 ,
414+ gap: 2 ,
415+ },
416+ ` ` `
417+ 
418+ - Long Dotted Stroke Style
419+ ` ` ` ts
420+ export type LongDottedOpt = {
421+ /** Line cap style for long dotted line, square: square cap, round: round cap, default value is round */
422+ lineCap : "square " | "round ";
423+ /** Long dotted line, single segment length, default value is 1, i.e., single segment length is 1 * thickness */
424+ segment : number ;
425+ /** Long dotted line, single segment gap, default value is 2, i.e., single segment gap is 2 * thickness */
426+ gap : number ;
427+ };
428+ /** Long dotted stroke style */
429+ longDottedStroke: {
430+ lineCap: " round" ,
431+ segment: 2 ,
432+ gap: 3 ,
433+ },
434+ ` ` `
435+ 
436+ - Normal Pen Style
437+ ` ` ` ts
438+ export type NormalOpt = {
439+ /** Line cap style, square: square cap, round: round cap, default value is round */
440+ lineCap : "square " | "round ";
441+ };
442+ /** Normal pen style */
443+ normalStroke: {
444+ lineCap: " round" ,
445+ }
446+ ` ` `
447+ 
448+
449+ - Text Custom Style
450+ ` ` ` ts
451+ export type TextEditorOpt = {
452+ /** Whether to show the floating bar */
453+ showFloatBar ?: boolean ;
454+ /** Whether it can be switched by selector tool */
455+ canSelectorSwitch ?: boolean ;
456+ /** Whether to automatically wrap at the right boundary */
457+ rightBoundBreak ?: boolean ;
458+ /** Extended font list */
459+ extendFontFaces ?: { fontFamily : string ; src : string }[];
460+ /** Font loading timeout, unit: milliseconds */
461+ loadFontFacesTimeout?: number;
462+ };
463+ // For example: Set unified font library
464+ textEditor: {
465+ showFloatBar: false ,
466+ canSelectorSwitch: false ,
467+ rightBoundBreak: true ,
468+ extendFontFaces: [
469+ {
470+ fontFamily: " Noto Sans SC" ,
471+ src: " https://fonts.gstatic.com/s/opensans/v44/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-mu0SC55I.woff2" ,
472+ },
473+ ],
474+ loadFontFacesTimeout: 20000 ,
475+ },
476+ ` ` `
477+ Need to be combined with CSS style implementation
478+ ` ` ` css
479+ @font- face {
480+ font- family: " Noto Sans SC" ;
481+ src: url (" https://fonts.gstatic.com/s/opensans/v44/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-mu0SC55I.woff2" )
482+ format (" woff2" );
483+ font- display: swap;
484+ }
485+ html {
486+ font- family: " Noto Sans SC" ;
487+ }
488+ ` ` `
489+
398490<!-- 6. Handwriting graphics automatic association function: 'autoDraw' (version >=1.1.7)
399491 ` ` ` js
400492 export type AutoDrawOptions = {
@@ -434,6 +526,12 @@ The following interfaces are involved:
434526 subWorkerUrl ?: string ;
435527 };
436528 export type ExtrasOptions = {
529+ /** Whether to use simple mode, default value is ``false``
530+ * true: Simple mode:
531+ 1. Drawing will use a single worker, and Bezier smoothing cannot be used during pen drawing.
532+ 2. Remove some new features: minimap, pointerPen (laser pointer), autoDraw plugin.
533+ */
534+ useSimple : boolean ;
437535 /** Whether to use worker, the default value is 'auto'
438536 * auto: Automatic selection (Use webWorker if your browser supports offscreenCanvas; otherwise, use the main thread)
439537 * mainThread: Use the main thread, canvas, to draw data.
0 commit comments