harmony 鸿蒙drawing_typeface.h

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

drawing_typeface.h

Overview

The drawing_typeface.h file declares the functions related to the typeface in the drawing module. Different platforms have their own default typefaces. You can also parse the .ttf file to obtain the typefaces specified by the third party, such as SimSun and SimHei.

File to include: <native_drawing/drawing_typeface.h>;

Library: libnative_drawing.so

Since: 11

Related module: Drawing

Summary

Functions

Name Description
OH_Drawing_Typeface * OH_Drawing_TypefaceCreateDefault (void) Creates a default OH_Drawing_Typeface object.
OH_Drawing_Typeface * OH_Drawing_TypefaceCreateFromFile (const char *path, int index) Creates an OH_Drawing_Typeface object through a file.
OH_Drawing_Typeface * OH_Drawing_TypefaceCreateFromFileWithArguments (const char *path, const OH_Drawing_FontArguments *fontArguments) Creates an OH_Drawing_Typeface object with font arguments through a file. If the OH_Drawing_Typeface object does not support the variation described in the font arguments, this function creates an OH_Drawing_Typeface object with the default font arguments. In this case, this function provides the same capability as OH_Drawing_TypefaceCreateFromFile.
OH_Drawing_Typeface * OH_Drawing_TypefaceCreateFromCurrent (const OH_Drawing_Typeface *current, const OH_Drawing_FontArguments *fontArguments) Creates an OH_Drawing_Typeface object with font arguments based on an existing OH_Drawing_Typeface object.
OH_Drawing_Typeface * OH_Drawing_TypefaceCreateFromStream (OH_Drawing_MemoryStream *, int32_t index) Creates an OH_Drawing_Typeface object through a memory stream. If the memory stream is an invalid font file, a null pointer is returned. After the memory stream is passed in, the ownership is transferred and you cannot release it.
void OH_Drawing_TypefaceDestroy (OH_Drawing_Typeface *) Destroys an OH_Drawing_Typeface object and reclaims the memory occupied by the object.
OH_Drawing_FontArguments * OH_Drawing_FontArgumentsCreate (void) Creates an OH_Drawing_FontArguments object. The font arguments are used to create an OH_Drawing_Typeface object with custom attributes.
OH_Drawing_ErrorCode OH_Drawing_FontArgumentsAddVariation (OH_Drawing_FontArguments *fontArguments, const char *axis, float value) Adds a variation to an OH_Drawing_FontArguments object.
OH_Drawing_ErrorCode OH_Drawing_FontArgumentsDestroy (OH_Drawing_FontArguments *fontArguments) Destroys an OH_Drawing_FontArguments object.

你可能感兴趣的鸿蒙文章

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  赞