From 290196dd60b1bc337c7fb8dc4de56fdb748379d4 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Tue, 13 Jun 2023 16:54:31 +0800 Subject: [PATCH] Update docs (18873) Signed-off-by: ester.zhou --- .../quick-start/multi-hap-principles.md | 2 +- .../quick-start/shared-guide.md | 2 +- .../reference/apis/js-apis-font.md | 64 +++++++++++++++++++ .../apis/js-apis-system-date-time.md | 2 +- .../reference/apis/js-apis-system-time.md | 6 +- .../arkui-ts/ts-universal-attributes-popup.md | 4 +- 6 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 en/application-dev/reference/apis/js-apis-font.md diff --git a/en/application-dev/quick-start/multi-hap-principles.md b/en/application-dev/quick-start/multi-hap-principles.md index 9268c0ddaf..82a4e6c8e2 100644 --- a/en/application-dev/quick-start/multi-hap-principles.md +++ b/en/application-dev/quick-start/multi-hap-principles.md @@ -4,7 +4,7 @@ The multi-HAP mechanism is used to facilitate modular management for developers. There is no one-to-one mapping between the HAP and the running process of the application. The detailed running mechanism is as follows: -- By default, all UIAbility, ServiceExtensionAbility, and DataShareExtensionAbility components of an application (with the same bundle name) run in the same independent process, and other ExtensionAbility components of the same type run in separate processes. +- By default, all UIAbility, ServiceExtensionAbility, and DataShareExtensionAbility components of an application (with the same bundle name) run in the same independent process (known as the main process), and other ExtensionAbility components of the same type run in separate processes. - The HAP file supports the process configuration through the **process** tag in the **module.json5** (stage model) or **config.json** (FA model) file. This feature is supported only by system applications. If **process** is configured for an HAP file, all components of the HAP file run in an independent process. Multiple HAP files can be configured with the same process, in which case the HAP files run in the same process. For details about the process configuration, see [module.json5 Configuration File](module-configuration-file.md). diff --git a/en/application-dev/quick-start/shared-guide.md b/en/application-dev/quick-start/shared-guide.md index 7d2ddb814e..040f8dfd1b 100644 --- a/en/application-dev/quick-start/shared-guide.md +++ b/en/application-dev/quick-start/shared-guide.md @@ -1,6 +1,6 @@ # Shared Package Overview -OpenHarmony provides two types of shared packages: [Harmony Achive (HAR)](har-package.md) static shared package and Harmony Shared Package (HSP) dynamic shared package. +OpenHarmony provides two types of shared packages: [Harmony Archive (HAR)](har-package.md) static shared package and Harmony Shared Package (HSP) dynamic shared package. Both the HAR and HSP are used to share code and resources and can contain code, C++ libraries, resources, and configuration files. The biggest differences between them are as follows: The code and resources in the HAR are compiled with the invoking module, and if there are multiple invoking modules, the build product contains multiple copies of the same code and resources; the code and resources in the HSP can be compiled independently, and the build product contains only one copy of the code and resources. diff --git a/en/application-dev/reference/apis/js-apis-font.md b/en/application-dev/reference/apis/js-apis-font.md new file mode 100644 index 0000000000..0b7d7fb3ab --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-font.md @@ -0,0 +1,64 @@ +# @ohos.font (Custom Font Registration) + +The **font** module provides APIs for registering custom fonts. + +> **NOTE** +> +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + +## Modules to Import + +```ts +import font from '@ohos.font' +``` + +## font.registerFont + +registerFont(options: FontOptions): void + +Registers a custom font with the font manager. + +**System capability**: SystemCapability.ArkUI.ArkUI.Full + +**Parameters** + +| Name | Type | Mandatory | Description | +| ------- | --------------------------- | ---- | ----------- | +| options | [FontOptions](#fontoptions) | Yes | Information about the custom font to register.| + +## FontOptions + +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------ | +| familyName | string | Yes | Name of the custom font to register. | +| familySrc | string | Yes | Path of the custom font to register.| + +## Example + +```ts +// xxx.ets +import font from '@ohos.font'; + +@Entry +@Component +struct FontExample { + @State message: string =' Hello, World' + + aboutToAppear() { + font.registerFont({ + familyName: 'medium', + familySrc: '/font/medium.ttf' + }) + } + + build() { + Column() { + Text(this.message) + .align(Alignment.Center) + .fontSize(20) + .fontFamily('medium') // medium: name of the custom font to register. + .height('100%') + }.width('100%') + } +} +``` diff --git a/en/application-dev/reference/apis/js-apis-system-date-time.md b/en/application-dev/reference/apis/js-apis-system-date-time.md index b7ea33fa58..c457247270 100644 --- a/en/application-dev/reference/apis/js-apis-system-date-time.md +++ b/en/application-dev/reference/apis/js-apis-system-date-time.md @@ -128,7 +128,7 @@ Obtains the time elapsed since the Unix epoch. This API uses an asynchronous cal | Name | Type | Mandatory| Description | | -------- | ----------- | ---- | ---------------------------------- | -| callback | AsyncCallback<number> | Yes | Callback used to return the time elapsed since the Unix epoch. | +| callback | AsyncCallback<number> | Yes | Callback used to return the time elapsed since the Unix epoch, in milliseconds. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-system-time.md b/en/application-dev/reference/apis/js-apis-system-time.md index ebeafe6fb8..1d236cc303 100644 --- a/en/application-dev/reference/apis/js-apis-system-time.md +++ b/en/application-dev/reference/apis/js-apis-system-time.md @@ -191,7 +191,7 @@ Obtains the time elapsed since the Unix epoch. This API uses a promise to return | Name| Type | Mandatory| Description | | ------ | ------- | ---- | ------------------------- | -| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| +| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.
Default value: **false** | **Return value** @@ -310,7 +310,7 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th | Name| Type | Mandatory| Description | | ------ | ------- | ---- | ----------------------------------- | -| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| +| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.
Default value: **false** | **Return value** @@ -429,7 +429,7 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th | Name| Type | Mandatory| Description | | ------ | ------- | ---- | ------------------------------- | -| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| +| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.
Default value: **false** | **Return value** diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md index 0e588d01fb..5de273e53d 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md @@ -40,7 +40,7 @@ You can bind a popup to a component, specifying its content, interaction logic, | Name | Type | Mandatory | Description | | ---------------------------- | ---------------------------------------- | ---- | ---------------------------------------- | -| builder | [CustomBuilder](ts-types.md#custombuilder8) | Yes | Popup builder. | +| builder | [CustomBuilder](ts-types.md#custombuilder8) | Yes | Popup builder.
**NOTE**
The **popup** attribute is a universal attribute. A custom popup does not support display of another popup. The **position** attribute cannot be used for the first-layer container under the builder. If the **position** attribute is used, the popup will not be displayed. | | placement | [Placement](ts-appendix-enums.md#placement8) | No | Preferred position of the popup. If the set position is insufficient for holding the popup, it will be automatically adjusted.
Default value: **Placement.Bottom**| | popupColor | [ResourceColor](ts-types.md#resourcecolor) | No | Color of the popup. | | enableArrow | boolean | No | Whether to display an arrow.
Since API version 9, if the position set for the popup is not large enough, the arrow will not be displayed. For example, if **placement** is set to **Left**, but the popup height (80 vp) is less than the sum of the arrow width (32 vp) and diameter of popup rounded corner (48 vp), the arrow will not be displayed.
Default value: **true**| @@ -112,7 +112,7 @@ struct PopupExample { .bindPopup(this.customPopup, { builder: this.popupBuilder, placement: Placement.Top, - maskColor: '0x33000000', + mask: {color:'0x33000000'}, popupColor: Color.Yellow, enableArrow: true, showInSubWindow: false, -- GitLab