diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.8.5/changelogs-arkui.md b/en/release-notes/changelogs/OpenHarmony_4.0.8.5/changelogs-arkui.md index b11e318f5f61130ce0665ae0f4fe31671a58d409..98452950d49d3037a6cf85551efe28860a7236d1 100644 --- a/en/release-notes/changelogs/OpenHarmony_4.0.8.5/changelogs-arkui.md +++ b/en/release-notes/changelogs/OpenHarmony_4.0.8.5/changelogs-arkui.md @@ -1,6 +1,6 @@ # ArkUI Subsystem Changelog -## cl.arkui.1 Change in the Priority of alignContent and align Attributes for \ +## cl.arkui.1 Change in the Priority of alignContent and align Attributes for the \ Component Changed the priority of **alignContent** and **align** as follows: @@ -11,7 +11,6 @@ API version 10 and later: The last set attribute prevails. When two attributes provide the same functions, the last set attribute takes effect. This rule applies to **alignContent** and **align**, both of which set the alignment mode when used for the **\** component. **Example** - ```ts // xxx.ets @Entry @@ -41,3 +40,49 @@ API version 10 and later: Child components are arranged based on the **alignCont **Change Impact** When both **alignContent** and **align** attributes are set, the last set attribute prevails. + +## cl.arkui.2 Behavior Change of the fillText and strokeText APIs of the \ Component + + +When the **fillText** and **strokeText** APIs are used to draw text, no text wrapping occurs. + +**Example** +```ts +// xxx.ets +@Entry +@Component +struct FillText { + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() =>{ + this.context.font = '50px sans-serif' + this.context.fillText("Hello World!", 0, 100) + this.context.fillText("Hello World! This is a long string to fully show", 0, 150) + this.context.strokeText("Hello World!", 0, 250) + this.context.strokeText("Hello World! This is a long string to fully show", 0, 300) + }) + } + .width('100%') + .height('100%') + } +} +``` + +API version 9 and earlier: When the **fillText** and **strokeText** APIs are used to draw text, the text is wrapped based on the component width. + +![stack](figures/api9filltext.jpeg) + +API version 10 and later: When the **fillText** and **strokeText** APIs are used to draw text, no text wrapping occurs. + +![stack](figures/api10filltext.jpeg) + +**Change Impact** + +The text appearance is affected now that the text is not wrapped based on the component width. diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.8.5/figures/api10filltext.jpeg b/en/release-notes/changelogs/OpenHarmony_4.0.8.5/figures/api10filltext.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..36593fdc0a4f8386c703094e58543c19a83c16fd Binary files /dev/null and b/en/release-notes/changelogs/OpenHarmony_4.0.8.5/figures/api10filltext.jpeg differ diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.8.5/figures/api9filltext.jpeg b/en/release-notes/changelogs/OpenHarmony_4.0.8.5/figures/api9filltext.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..f4b4ecdfaafa614fc42af83d847654305d492fb9 Binary files /dev/null and b/en/release-notes/changelogs/OpenHarmony_4.0.8.5/figures/api9filltext.jpeg differ