cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

label processing string & remove shared label info

Open LinYunMo opened this issue 2 years ago • 4 comments

Re: https://github.com/cocos/cocos-engine/pull/15890 https://github.com/cocos/cocos-engine/issues/15693 https://github.com/cocos/3d-tasks/issues/17388

Changelog


Continuous Integration

This pull request:

  • [ ] needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • [ ] does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • [ ] changes public API, and have ensured backward compatibility with deprecated features.
  • [ ] affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • [ ] affects file structure of the build package or build configuration which requires user project upgrade.
  • [ ] introduces breaking changes, please list all changes, affected features and the scope of violation.

LinYunMo avatar Sep 20 '23 09:09 LinYunMo

@cocos-robot run test cases

LinYunMo avatar Sep 20 '23 09:09 LinYunMo

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -60083,8 +60083,59 @@
              * @param {Number} y
              */
             drawTextureAt(image: ImageAsset, x: number, y: number): void;
         }
+        export interface _cocos_2d_assembler_label_font_utils__ILabelInfo {
+            fontSize: number;
+            fontFamily: string;
+            fontDesc: string;
+            color: math.Color;
+            isOutlined: boolean;
+            out: math.Color;
+            margin: number;
+            fontScale: number;
+        }
+        export class _cocos_2d_assembler_label_font_utils__LetterTexture {
+            image: ImageAsset | null;
+            labelInfo: _cocos_2d_assembler_label_font_utils__ILabelInfo;
+            char: string;
+            data: _cocos_2d_assembler_label_font_utils__ISharedLabelData | null;
+            canvas: HTMLCanvasElement | null;
+            context: CanvasRenderingContext2D | null;
+            width: number;
+            height: number;
+            offsetY: number;
+            hash: string;
+            constructor(char: string, labelInfo: _cocos_2d_assembler_label_font_utils__ILabelInfo, hash: string);
+            updateRenderData(): void;
+            destroy(): void;
+        }
+        export class _cocos_2d_assembler_label_font_utils__FontLetterDefinition {
+            u: number;
+            v: number;
+            w: number;
+            h: number;
+            texture: _cocos_2d_assembler_label_font_utils__LetterRenderTexture | null;
+            offsetX: number;
+            offsetY: number;
+            valid: boolean;
+            xAdvance: number;
+        }
+        export class _cocos_2d_assembler_label_font_utils__LetterAtlas {
+            get width(): number;
+            get height(): number;
+            fontDefDictionary: _cocos_2d_assets_bitmap_font__FontAtlas;
+            constructor(width: number, height: number);
+            insertLetterTexture(letterTexture: _cocos_2d_assembler_label_font_utils__LetterTexture): _cocos_2d_assembler_label_font_utils__FontLetterDefinition | null;
+            update(): void;
+            reset(): void;
+            destroy(): void;
+            getTexture(): any;
+            beforeSceneLoad(): void;
+            clearAllCache(): void;
+            getLetter(key: string): any;
+            getLetterDefinitionForChar(char: string, style: _cocos_2d_assembler_label_text_style__TextStyle, fontScale: number): any;
+        }
         export class _cocos_2d_assembler_label_text_style__TextStyle {
             isBold: boolean;
             isItalic: boolean;
             isUnderline: boolean;
@@ -60106,8 +60157,10 @@
             fontFamily: string;
             fontDesc: string;
             fntConfig: _cocos_2d_assets_bitmap_font__IConfig | null;
             spriteFrame: SpriteFrame | null;
+            hash: string;
+            fontAtlas: _cocos_2d_assets_bitmap_font__FontAtlas | _cocos_2d_assembler_label_font_utils__LetterAtlas | null;
             fontScale: number;
             reset(): void;
         }
         export class _cocos_2d_assembler_label_text_layout__TextLayout {
@@ -60146,15 +60199,24 @@
             uiTransAnchorX: number;
             uiTransAnchorY: number;
             reset(): void;
         }
+        export class _cocos_2d_assembler_label_text_processing__LetterInfo {
+            char: string;
+            valid: boolean;
+            x: number;
+            y: number;
+            line: number;
+            hash: string;
+        }
         export class _cocos_2d_assembler_label_text_output_data__TextOutputLayoutData {
             parsedString: string[];
             nodeContentSize: math.Size;
             canvasSize: math.Size;
             canvasPadding: math.Rect;
             contentSizeExtend: math.Size;
             startPosition: math.Vec2;
+            lettersInfo: _cocos_2d_assembler_label_text_processing__LetterInfo[];
             reset(): void;
         }
         export class _cocos_2d_renderer_native_2d__NativeBatcher2d {
             syncMeshBuffersToNative(accId: number, buffers: _cocos_2d_renderer_native_2d__NativeUIMeshBuffer[]): any;

github-actions[bot] avatar Sep 20 '23 09:09 github-actions[bot]

@cocos-robot run test cases

LinYunMo avatar Sep 22 '23 06:09 LinYunMo

@cocos-robot run test cases

LinYunMo avatar Sep 25 '23 02:09 LinYunMo