From: luozheng <1732036298@qq.com> Date: Tue, 25 Mar 2025 06:47:13 +0000 (+0800) Subject: 与字体相关文件合并提交 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~406 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1702%2Fhead;p=mirrors%2FFD230.git 与字体相关文件合并提交 --- diff --git a/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h b/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h index a31383746..fd819e28f 100644 --- a/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h +++ b/code/sdk/middleware/services/gui/uikit/utils/interfaces/innerkits/graphic_config.h @@ -502,15 +502,53 @@ namespace OHOS { */ #ifdef VERSION_IOT -#define DEFAULT_VECTOR_FONT_FILENAME "HarmonyOS_Sans_SC_Regular.ttf" +#define HARMONYOS_VECTOR_FONT_FILENAME "HarmonyOS_Sans_SC_Regular.ttf" +#define GILROY_REGULAR_FONT "Gilroy_Regular.ttf" +#define GILROY_BOLD_FONT "Gilroy_Bold.ttf" +#define GILROY_MEDIUM_FONT "Gilroy_Medium.ttf" +#define SHEEPING_CATS_FONT "Sheeping_Cats.ttf" +#define AUDIOWIDE_REGULAR_FONT "Audiowide_Regular.ttf" +//多国语言字体 +#define KOREA_FONT "Orbit-Regular.ttf" //韩语 +#define HINDI_FONT "hindi.ttf" //印地语 +#define HEBREW_FONT "DejaVuSans.ttf"//希伯来语 +#define HARMONYOS_VECTOR_ARABIC_FILENAME "HarmonyOS_Sans_Naskh_Arabic_Regular.ttf"//阿拉伯语 +#define ANUPHAN_FONT "Anuphan-VariableFont_wght.ttf"//泰语 + #else #if ENABLE_VECTOR_FONT -#define DEFAULT_VECTOR_FONT_FILENAME "SourceHanSansSC-Regular.otf" +#define HARMONYOS_VECTOR_FONT_FILENAME "SourceHanSansSC-Regular.otf" #else -#define DEFAULT_VECTOR_FONT_FILENAME "SourceHanSansSC-Regular" +#define HARMONYOS_VECTOR_FONT_FILENAME "SourceHanSansSC-Regular" #endif #endif + +/** + * return char* 当前字体名 + */ +char* get_current_global_font_name(void); + +/** + * return 0 success + */ +int set_current_global_font_name(const char* fontname); + +/** + * return 1 从右到左 + * return 0 从左到右 + */ +int get_current_font_direction(void); + +const char* get_language_font(uint8_t id); + +bool is_load_languages(uint8_t id); + +#define DEFAULT_VECTOR_FONT_FILENAME get_current_global_font_name() + + +#define DEFAULT_VECTOR_FONT_FILENAME_EN HARMONYOS_VECTOR_FONT_FILENAME + /* resources path. */ #ifdef VERSION_IOT #define RES_PATH "/user/res/" @@ -575,6 +613,7 @@ static constexpr const char* DEFAULT_SCREENSHOT_PATH = "/storage/screenshot.bin" static constexpr const char* DEFAULT_DUMP_DOM_TREE_PATH = "/storage/dump_dom_tree.json"; /* Default file path for font */ static constexpr const char* VECTOR_FONT_DIR = "/user/res/"; +static constexpr const char* NEW_FONT_DIR = "user/res/font_library/"; #else /* Default file path for screenshots */ static constexpr const char* DEFAULT_SCREENSHOT_PATH = "/storage/screenshot.bin"; @@ -590,11 +629,11 @@ static constexpr uint8_t WMS_MAIN_TASK_PERIOD = 16; static constexpr uint8_t IMG_CACHE_SIZE = 64; /* Maximum number of cached images. The default value is 64. */ static constexpr uint8_t INDEV_READ_PERIOD = 10; /* Input event read cycle. The default value is 10 ms. */ /* Drag distance threshold of a drag event. The default value is 10px. */ -static constexpr uint8_t INDEV_DRAG_LIMIT = 10; +static constexpr uint8_t INDEV_DRAG_LIMIT = 10;//20; 恢复原始默认值,让拖动更容易。 /* Maximum depth of view nesting. The default value is 64. */ static constexpr uint8_t COMPONENT_NESTING_DEPTH = 64; /* Long-press event threshold. The default value is 1000 ms. */ -static constexpr uint16_t INDEV_LONG_PRESS_TIME = 1000; +static constexpr uint16_t INDEV_LONG_PRESS_TIME = 450;//1000; /* Delay for reporting a press event on a draggable object. The default value is 100 ms. */ static constexpr uint16_t INDEV_PRESS_TIME_IN_DRAG = 100; /* Maximum number of bytes in a text that can be continuously displayed. The default value is 4096 bytes. */ diff --git a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h index 95e77aa54..546db4892 100644 --- a/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h +++ b/code/sdk/open_source/openharmony/foundation/ace/ace_engine_lite/base/js_fwk_common.h @@ -117,7 +117,7 @@ constexpr uint8_t FONT_FAMILY_FILE_NAME_SIZE = 128; #ifdef FEATURE_COMPONENT_CANVAS constexpr uint8_t DEFAULT_FONT_LETTERSPACE = 2; #endif // FEATURE_COMPONENT_CANVAS -constexpr char DEFAULT_FONT_FAMILY[] = DEFAULT_VECTOR_FONT_FILENAME; +constexpr char DEFAULT_FONT_FAMILY[] = HARMONYOS_VECTOR_FONT_FILENAME; // common attributes constexpr char ATTR_WIDTH[] = "width"; // tab-bar | image-animator