@@ -375,8 +375,6 @@ module: {
375375 setMemberState({currentApplianceName: ApplianceNames.shape, shapeType: ShapeType.SpeechBalloon, placement: 'bottomLeft'});
376376 ` ` `
377377 ! [Image](https: // github.com/user-attachments/assets/6d52dedf-ca21-406d-a353-d801273b98bf)
378-
379-
3803783. 分屏显示笔记(小白板功能),需要结合[` @netless/app-little-white-board` ](https: // github.com/netless-io/app-little-white-board) (Version >=1.1.3)
381379 ! [Image](https: // github.com/user-attachments/assets/20810ea6-7d85-4e72-b75f-185599fffaf8)
3823804. 小地图功能 (Version >= 1.1 .6 )
@@ -408,6 +406,97 @@ module: {
408406 cancelFilterRender(viewId: string, isSync?:boolean): void;
409407 ` ` `
410408 ! [Image](https: // github.com/user-attachments/assets/7952ee1d-4f9c-4e86-802a-bac8e4ae6a51)
409+ 6. ExtrasOption自定义教具配置
410+ - 自定义画笔样式
411+ - 短虚线样式
412+ ` ` ` ts
413+ export type DottedOpt = {
414+ /** 虚线端点样式, square: 平头, round: 圆头, 默认值为 round */
415+ lineCap: "square" | "round";
416+ /** 虚线,单线段长度, 默认值为 1, 即单线段长度为 1 */
417+ segment: number;
418+ /** 虚线,单线段间隔, 默认值为 2, 即单线段间隔为 2 * thickness */
419+ gap: number;
420+ };
421+ /** 短虚线样式 */
422+ dottedStroke: {
423+ lineCap: "round",
424+ segment: 1,
425+ gap: 2,
426+ },
427+ ` ` `
428+ ! [Image](https: // github.com/user-attachments/assets/5dc7e2bf-c285-45f0-89d2-849b4792dc7e)
429+ - 长虚线样式
430+ ` ` ` ts
431+ export type LongDottedOpt = {
432+ /** 长虚线端点样式, square: 平头, round: 圆头, 默认值为 round */
433+ lineCap: "square" | "round";
434+ /** 长虚线,单线段长度, 默认值为 1, 即单线段长度为 1 * thickness */
435+ segment: number;
436+ /** 长虚线,单线段间隔, 默认值为 2, 即单线段间隔为 2 * thickness */
437+ gap: number;
438+ };
439+ /** 长虚线线样式 */
440+ longDottedStroke: {
441+ lineCap: "round",
442+ segment: 2,
443+ gap: 3,
444+ },
445+ ` ` `
446+ ! [Image](https: // github.com/user-attachments/assets/a305c1a1-b366-444a-ace6-3e0ecbf5ad19)
447+ - 普通画笔样式
448+ ` ` ` ts
449+ export type NormalOpt = {
450+ /** 端点样式, square: 平头, round: 圆头, 默认值为 round */
451+ lineCap: "square" | "round";
452+ };
453+ /** 普通画笔样式 */
454+ normalStroke: {
455+ lineCap: "round",
456+ }
457+ ` ` `
458+ ! [Image](https: // github.com/user-attachments/assets/23979f81-057a-408f-8302-de228ef00b4f)
459+
460+ - 文字自定义样式
461+ ` ` ` ts
462+ export type TextEditorOpt = {
463+ /** 是否显示浮动栏 */
464+ showFloatBar?: boolean;
465+ /** 是否可以通过selector教具切换 */
466+ canSelectorSwitch?: boolean;
467+ /** 是否右边界自动换行 */
468+ rightBoundBreak?: boolean;
469+ /** 扩展字体列表 */
470+ extendFontFaces?: { fontFamily: string; src: string }[];
471+ /** 加载字体超时时间,单位:毫秒 */
472+ loadFontFacesTimeout?: number;
473+ };
474+ // 比如: 设置统一字体库
475+ textEditor: {
476+ showFloatBar: false,
477+ canSelectorSwitch: false,
478+ rightBoundBreak: true,
479+ extendFontFaces: [
480+ {
481+ fontFamily: "Noto Sans SC",
482+ src: "https://fonts.gstatic.com/s/opensans/v44/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-mu0SC55I.woff2",
483+ },
484+ ],
485+ loadFontFacesTimeout: 20000,
486+ },
487+ ` ` `
488+ 需要结合css style实现
489+ ` ` ` css
490+ @font-face {
491+ font-family: "Noto Sans SC";
492+ src: url("https://fonts.gstatic.com/s/opensans/v44/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-mu0SC55I.woff2")
493+ format("woff2");
494+ font-display: swap;
495+ }
496+ html {
497+ font-family: "Noto Sans SC";
498+ }
499+ ` ` `
411500<!-- 6. 手写图形自动联想功能: ` autoDraw` (version >= 1.1 .7 )
412501 ` ` ` js
413502 export type AutoDrawOptions = {
@@ -448,6 +537,12 @@ module: {
448537 subWorkerUrl?: string;
449538 };
450539 export type ExtrasOptions = {
540+ /** 是否使用简单模式, 默认值为 ` ` false` `
541+ * true: 简单模式:
542+ 1、绘制将使用单worker绘制,画笔过程中无法使用贝塞尔圆滑处理。
543+ 2、移除部分新功能:小地图、pointerPen(激光笔)、autoDraw插件。
544+ */
545+ useSimple: boolean;
451546 /** 是否使用 worker, 默认值为 ` ` auto` `
452547 * auto: 自动选择(如果浏览器支持 offscreenCanvas 则使用 webWorker, 否则使用主线程)
453548 * mainThread: 使用主线程, canvas 绘制数据。
0 commit comments