fix export api bug (#14409)

This commit is contained in:
ChiaNing
2023-02-28 18:36:47 +08:00
committed by GitHub
parent 9a6b619b88
commit c5b60cb5be
2 changed files with 13 additions and 3 deletions
+1
View File
@@ -25,4 +25,5 @@
import './font-loader';
export * from './html-text-parser';
export * from './text-utils';
export { dynamicAtlasManager } from './dynamic-atlas/atlas-manager';
+12 -3
View File
@@ -168,7 +168,9 @@ const WRAP_INSPECTION = true;
// reference: https://en.wikipedia.org/wiki/UTF-16
const highSurrogateRex = /[\uD800-\uDBFF]/;
const lowSurrogateRex = /[\uDC00-\uDFFF]/;
/**
* @deprecated since v3.7.2, this is an engine private interface that will be removed in the future.
*/
export function isUnicodeCJK (ch: string) {
const __CHINESE_REG = /^[\u4E00-\u9FFF\u3400-\u4DFF]+$/;
const __JAPANESE_REG = /[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g;
@@ -176,6 +178,9 @@ export function isUnicodeCJK (ch: string) {
return __CHINESE_REG.test(ch) || __JAPANESE_REG.test(ch) || __KOREAN_REG.test(ch);
}
/**
* @deprecated since v3.7.2, this is an engine private interface that will be removed in the future.
*/
// Checking whether the character is a whitespace
export function isUnicodeSpace (ch: string) {
const chCode = ch.charCodeAt(0);
@@ -191,7 +196,9 @@ export function isUnicodeSpace (ch: string) {
|| chCode === 8287
|| chCode === 12288);
}
/**
* @deprecated since v3.7.2, this is an engine private interface that will be removed in the future.
*/
export function safeMeasureText (ctx: CanvasRenderingContext2D, string: string, desc?: string) {
const font = desc || ctx.font;
const key = `${font}\uD83C\uDFAE${string}`;
@@ -264,7 +271,9 @@ export function getEnglishWordPartAtLast (stringToken: string) {
const result = LAST_ENGLISH_REG.exec(stringToken);
return result;
}
/**
* @deprecated since v3.7.2, this is an engine private interface that will be removed in the future.
*/
export function fragmentText (stringToken: string, allWidth: number, maxWidth: number, measureText: (string: string) => number) {
// check the first character
const wrappedWords: string[] = [];