harmony 鸿蒙drawing_text_font_descriptor.h

  • 2025-06-12
  • 浏览 (4)

drawing_text_font_descriptor.h

Overview

The drawing_text_font_descriptor.h file declares the capabilities of font information, such as obtaining font information and searching for a font.

File to include:

Library: libnative_drawing.so

Since: 14

Related module: Drawing

Summary

Types

Name Description
typedef enum OH_Drawing_SystemFontType OH_Drawing_SystemFontType Defines an enum for the system font types.

Enums

Name Description
OH_Drawing_SystemFontType { ALL = 1 << 0, GENERIC = 1 << 1, STYLISH = 1 << 2, INSTALLED = 1 << 3, CUSTOMIZED = 1 << 4 } Enumerates the system font types.

Functions

Name Description
OH_Drawing_FontDescriptor * OH_Drawing_MatchFontDescriptors (OH_Drawing_FontDescriptor *, size_t *) Obtains all system font descriptors that match a font descriptor. In the OH_Drawing_FontDescriptor struct, the path field is not used for matching, and other fields are valid only when they are not set to their default values. If all fields in OH_Drawing_FontDescriptor are set to their default values, all system font descriptors are returned. If no matching is found, NULL is returned. When OH_Drawing_FontDescriptor is no longer required, call OH_Drawing_DestroyFontDescriptors to release the pointer to the object.
void OH_Drawing_DestroyFontDescriptors (OH_Drawing_FontDescriptor *, size_t) Releases an array of OH_Drawing_FontDescriptor objects.
OH_Drawing_FontDescriptor * OH_Drawing_GetFontDescriptorByFullName (const OH_Drawing_String *, OH_Drawing_SystemFontType) Obtains a font descriptor based on the font name and type. System fonts, style fonts, and user-installed fonts are supported. A font descriptor is a data structure that describes font features. It contains details of the font appearance and properties.
OH_Drawing_Array * OH_Drawing_GetSystemFontFullNamesByType (OH_Drawing_SystemFontType) Obtains an array of font names by font type.
const OH_Drawing_String * OH_Drawing_GetSystemFontFullNameByIndex (OH_Drawing_Array *, size_t) Obtains the font name with the specified index in the font name array.
void OH_Drawing_DestroySystemFontFullNames (OH_Drawing_Array *) Releases the memory occupied by the font name array obtained by font type.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkGraphics 2D

harmony 鸿蒙BufferHandle

harmony 鸿蒙ColorSpacePrimaries

harmony 鸿蒙DisplaySoloist_ExpectedRateRange

harmony 鸿蒙_drawing

harmony 鸿蒙NativeColorSpaceManager

harmony 鸿蒙NativeDisplaySoloist

harmony 鸿蒙NativeVsync

harmony 鸿蒙NativeWindow

harmony 鸿蒙OH_Drawing_BitmapFormat

0  赞