更新换行算法和APP-PUSH
This commit is contained in:
19
client/src/features/textWrap/measure/errors.ts
Normal file
19
client/src/features/textWrap/measure/errors.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Text Wrap - width-measurement 错误定义
|
||||
*
|
||||
* 约束:fontSpec 缺字段必须直接报错(简体中文),禁止隐式默认值。
|
||||
*/
|
||||
|
||||
export class MissingFontSpecError extends Error {
|
||||
readonly name = 'MissingFontSpecError';
|
||||
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
export function buildMissingFontSpecMessage(missingFields: string[]): string {
|
||||
const fields = missingFields.join(', ');
|
||||
return `fontSpec 缺少必填字段:${fields}。请在调用 wrapText() 时补齐 fontSpec(fontFamily/fontWeight/fontSize),禁止在测量层使用隐式默认值。`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user