1/* 2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#ifndef C_INCLUDE_DRAWING_FONT_H 17#define C_INCLUDE_DRAWING_FONT_H 18 19/** 20 * @addtogroup Drawing 21 * @{ 22 * 23 * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. 24 * 25 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 26 * 27 * @since 11 28 * @version 1.0 29 */ 30 31/** 32 * @file drawing_font.h 33 * 34 * @brief Declares functions related to the <b>font</b> object in the drawing module. 35 * 36 * @kit ArkGraphics2D 37 * @library libnative_drawing.so 38 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 39 * @since 11 40 * @version 1.0 41 */ 42 43#include "drawing_error_code.h" 44#include "drawing_types.h" 45 46#ifdef __cplusplus 47extern "C" { 48#endif 49 50/** 51 * @brief Creates an <b>OH_Drawing_Font</b> object. 52 * 53 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 54 * @return Returns the pointer to the <b>OH_Drawing_Font</b> object created. 55 * @since 11 56 * @version 1.0 57 */ 58OH_Drawing_Font* OH_Drawing_FontCreate(void); 59 60/** 61 * @brief Enumerates font hinting pattern. 62 * 63 * @since 12 64 * @version 1.0 65 */ 66typedef enum { 67 /** glyph outlines unchanged */ 68 FONT_HINTING_NONE, 69 /** minimal modification to improve contrast */ 70 FONT_HINTING_SLIGHT, 71 /** glyph outlines modified to improve contrast */ 72 FONT_HINTING_NORMAL, 73 /** modifies glyph outlines for maximum contrast */ 74 FONT_HINTING_FULL, 75} OH_Drawing_FontHinting; 76 77/** 78 * @brief Enumerates font edging effect. 79 * 80 * @since 12 81 * @version 1.0 82 */ 83typedef enum { 84 /** no transparent pixels on glyph edges */ 85 FONT_EDGING_ALIAS, 86 /** may have transparent pixels on glyph edges */ 87 FONT_EDGING_ANTI_ALIAS, 88 /** glyph positioned in pixel using transparency */ 89 FONT_EDGING_SUBPIXEL_ANTI_ALIAS, 90} OH_Drawing_FontEdging; 91 92/** 93 * @brief Sets whether the font baselines and pixels alignment when the transformation matrix is axis aligned. 94 * 95 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 96 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 97 * @param baselineSnap Indicates whether the font baselines and pixels alignment. 98 * @since 12 99 * @version 1.0 100 */ 101void OH_Drawing_FontSetBaselineSnap(OH_Drawing_Font*, bool baselineSnap); 102 103/** 104 * @brief Gets whether the font baselines and pixels alignment when the transformation matrix is axis aligned. 105 * 106 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 107 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 108 * @return Returns <b>true</b> if the font baselines and pixels alignment; returns <b>false</b> otherwise. 109 * @since 12 110 * @version 1.0 111 */ 112bool OH_Drawing_FontIsBaselineSnap(const OH_Drawing_Font*); 113 114/** 115 * @brief Sets whether the font uses sub-pixel rendering. 116 * 117 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 118 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 119 * @param isSubpixel Indicates whether the font uses sub-pixel rendering. 120 * @since 12 121 * @version 1.0 122 */ 123void OH_Drawing_FontSetSubpixel(OH_Drawing_Font*, bool isSubpixel); 124 125/** 126 * @brief Gets whether the font uses sub-pixel rendering. 127 * 128 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 129 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 130 * @return Returns <b>true</b> if the font uses sub-pixel rendering; returns <b>false</b> otherwise. 131 * @since 12 132 * @version 1.0 133 */ 134bool OH_Drawing_FontIsSubpixel(const OH_Drawing_Font*); 135 136/** 137 * @brief Sets whether the font outline is automatically adjusted. 138 * 139 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 140 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 141 * @param isForceAutoHinting Indicates whether the font outline is automatically adjusted. 142 * @since 12 143 * @version 1.0 144 */ 145void OH_Drawing_FontSetForceAutoHinting(OH_Drawing_Font*, bool isForceAutoHinting); 146 147/** 148 * @brief Gets whether the font outline is automatically adjusted. 149 * 150 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 151 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 152 * @return Returns <b>true</b> if the font outline is automatically adjusted; returns <b>false</b> otherwise. 153 * @since 12 154 * @version 1.0 155 */ 156bool OH_Drawing_FontIsForceAutoHinting(const OH_Drawing_Font*); 157 158/** 159 * @brief Sets an <b>OH_Drawing_Typeface</b> object for an <b>OH_Drawing_Font</b> object. 160 * 161 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 162 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 163 * @param OH_Drawing_Typeface Indicates the pointer to an <b>OH_Drawing_Typeface</b> object. 164 * @since 11 165 * @version 1.0 166 */ 167void OH_Drawing_FontSetTypeface(OH_Drawing_Font*, OH_Drawing_Typeface*); 168 169/** 170 * @brief Gets an <b>OH_Drawing_Typeface</b> object from the <b>OH_Drawing_Typeface</b> object. 171 * 172 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 173 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 174 * @return OH_Drawing_Typeface Indicates the pointer to an <b>OH_Drawing_Typeface</b> object. 175 * @since 12 176 * @version 1.0 177 */ 178OH_Drawing_Typeface* OH_Drawing_FontGetTypeface(OH_Drawing_Font*); 179 180/** 181 * @brief Sets text size for an <b>OH_Drawing_Font</b> object. 182 * 183 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 184 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 185 * @param textSize Indicates the text size. 186 * @since 11 187 * @version 1.0 188 */ 189void OH_Drawing_FontSetTextSize(OH_Drawing_Font*, float textSize); 190 191/** 192 * @brief Gets text size for an <b>OH_Drawing_Font</b> object. 193 * 194 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 195 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 196 * @return Returns the size of text. 197 * @since 12 198 * @version 1.0 199 */ 200float OH_Drawing_FontGetTextSize(const OH_Drawing_Font*); 201 202/** 203 * @brief Calculate number of glyphs represented by text. 204 * 205 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 206 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 207 * @param text Indicates the character storage encoded with text encoding. 208 * @param byteLength Indicates the text length in bytes. 209 * @param encoding Indicates the text encoding. 210 * @since 12 211 * @version 1.0 212 */ 213int OH_Drawing_FontCountText(OH_Drawing_Font*, const void* text, size_t byteLength, 214 OH_Drawing_TextEncoding encoding); 215 216/** 217 * @brief Converts text into glyph indices. 218 * 219 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 220 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 221 * @param text Indicates the character storage encoded with text encoding. 222 * @param byteLength Indicates the text length in bytes. 223 * @param encoding Indicates the text encoding. 224 * @param glyphs Indicates the storage for glyph indices. 225 * @param maxGlyphCount Indicates the storage capacity. 226 * @return Returns the number of glyph indices represented by text. 227 * @since 12 228 * @version 1.0 229 */ 230uint32_t OH_Drawing_FontTextToGlyphs(const OH_Drawing_Font*, const void* text, uint32_t byteLength, 231 OH_Drawing_TextEncoding encoding, uint16_t* glyphs, int maxGlyphCount); 232 233/** 234 * @brief Retrieves the advance for each glyph in glyphs. 235 * 236 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 237 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 238 * @param glyphs Indicates the array of glyph indices to be measured. 239 * @param count Indicates the number of glyphs. 240 * @param widths Indicates the text advances for each glyph returned to the caller. 241 * @since 12 242 * @version 1.0 243 */ 244void OH_Drawing_FontGetWidths(const OH_Drawing_Font*, const uint16_t* glyphs, int count, float* widths); 245 246/** 247 * @brief Measures the width of a single character. 248 * 249 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 250 * @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 251 * @param str Indicates the single character encoded in UTF-8. 252 * @param textWidth Indicates the width of the single character. 253 * @return Returns the error code. 254 * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. 255 * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, str 256 * and textWidth is nullptr or strlen(str) is 0. 257 * @since 12 258 * @version 1.0 259 */ 260OH_Drawing_ErrorCode OH_Drawing_FontMeasureSingleCharacter(const OH_Drawing_Font* font, const char* str, 261 float* textWidth); 262 263/** 264 * @brief Measures the width of text. 265 * 266 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 267 * @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 268 * @param text Indicates the character storage encoded with text encoding. 269 * @param byteLength Indicates the text length in bytes. 270 * @param encoding Indicates the text encoding. 271 * @param bounds Gets the bounding box relative to (0, 0) if not nullptr. 272 * @param textWidth Indicates the width of text. 273 * @return Returns the error code. 274 * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. 275 * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, text 276 * and textWidth is nullptr or byteLength is 0. 277 * @since 12 278 * @version 1.0 279 */ 280OH_Drawing_ErrorCode OH_Drawing_FontMeasureText(const OH_Drawing_Font* font, const void* text, size_t byteLength, 281 OH_Drawing_TextEncoding encoding, OH_Drawing_Rect* bounds, float* textWidth); 282 283/** 284 * @brief Enables or disables linearly scalable font for an <b>OH_Drawing_Font</b> object. 285 * 286 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 287 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 288 * @param isLinearText Indicates whether to enable linearly scalable font. 289 * @since 11 290 * @version 1.0 291 */ 292void OH_Drawing_FontSetLinearText(OH_Drawing_Font*, bool isLinearText); 293 294/** 295 * @brief Gets whether the font is linearly scalable. 296 * 297 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 298 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 299 * @return Returns <b>true</b> if the font is linearly scalable; returns <b>false</b> otherwise. 300 * @since 12 301 * @version 1.0 302 */ 303bool OH_Drawing_FontIsLinearText(const OH_Drawing_Font*); 304 305/** 306 * @brief Sets text skew on x-axis for an <b>OH_Drawing_Font</b> object. 307 * 308 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 309 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 310 * @param skewX Indicates the additional shear on x-axis relative to y-axis. 311 * @since 11 312 * @version 1.0 313 */ 314void OH_Drawing_FontSetTextSkewX(OH_Drawing_Font*, float skewX); 315 316/** 317 * @brief Gets text skew on x-axis for an <b>OH_Drawing_Font</b> object. 318 * 319 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 320 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 321 * @return Returns additional skew on x-axis relative to y-axis. 322 * @since 12 323 * @version 1.0 324 */ 325float OH_Drawing_FontGetTextSkewX(const OH_Drawing_Font*); 326 327/** 328 * @brief Enables or disables to increase stroke width to approximate bold fonts for an <b>OH_Drawing_Font</b> object. 329 * 330 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 331 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 332 * @param isFakeBoldText Indicates whether to enable to increase stroke width. 333 * @since 11 334 * @version 1.0 335 */ 336void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font*, bool isFakeBoldText); 337 338/** 339 * @brief Gets whether to increase the stroke width to approximate bold fonts. 340 * 341 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 342 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 343 * @return Returns <b>true</b> to increase the stroke width to approximate bold fonts; returns <b>false</b> otherwise. 344 * @since 12 345 * @version 1.0 346 */ 347bool OH_Drawing_FontIsFakeBoldText(const OH_Drawing_Font*); 348 349/** 350 * @brief Sets text scale on x-axis for an <b>OH_Drawing_Font</b> object. 351 * 352 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 353 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 354 * @param scaleX Indicates the text horizontal scale. 355 * @since 12 356 * @version 1.0 357 */ 358void OH_Drawing_FontSetScaleX(OH_Drawing_Font*, float scaleX); 359 360/** 361 * @brief Gets text scale on x-axis from an <b>OH_Drawing_Font</b> object. 362 * 363 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 364 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 365 * @return Returns text horizontal scale on x-axis. 366 * @since 12 367 * @version 1.0 368 */ 369float OH_Drawing_FontGetScaleX(const OH_Drawing_Font*); 370 371/** 372 * @brief Sets hinting pattern for an <b>OH_Drawing_Font</b> object. 373 * 374 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 375 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 376 * @param OH_Drawing_FontHinting Indicates the font hinting pattern. 377 * @since 12 378 * @version 1.0 379 */ 380void OH_Drawing_FontSetHinting(OH_Drawing_Font*, OH_Drawing_FontHinting); 381 382/** 383 * @brief Gets hinting pattern from an <b>OH_Drawing_Font</b> object. 384 * 385 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 386 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 387 * @return Returns the font hinting pattern. 388 * @since 12 389 * @version 1.0 390 */ 391OH_Drawing_FontHinting OH_Drawing_FontGetHinting(const OH_Drawing_Font*); 392 393/** 394 * @brief Sets whether to use bitmaps instead of outlines in the <b>OH_Drawing_Font</b> object. 395 * 396 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 397 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 398 * @param isEmbeddedBitmaps Indicates whether to use bitmaps instead of outlines. 399 * @since 12 400 * @version 1.0 401 */ 402void OH_Drawing_FontSetEmbeddedBitmaps(OH_Drawing_Font*, bool isEmbeddedBitmaps); 403 404/** 405 * @brief Gets whether to use bitmaps instead of outlines in the <b>OH_Drawing_Font</b> object. 406 * 407 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 408 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 409 * @return Returns <b>true</b> if using bitmaps instead of outlines; returns <b>false</b> otherwise. 410 * @since 12 411 * @version 1.0 412 */ 413bool OH_Drawing_FontIsEmbeddedBitmaps(const OH_Drawing_Font*); 414 415/** 416 * @brief Sets the font edging effect for an <b>OH_Drawing_Font</b> object. 417 * 418 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 419 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 420 * @param OH_Drawing_FontEdging Indicates the font edging effect. 421 * @since 12 422 * @version 1.0 423 */ 424void OH_Drawing_FontSetEdging(OH_Drawing_Font*, OH_Drawing_FontEdging); 425 426/** 427 * @brief Gets the font edging effect from an <b>OH_Drawing_Font</b> object. 428 * 429 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 430 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 431 * @return Returns the font edging effect. 432 * @since 12 433 * @version 1.0 434 */ 435OH_Drawing_FontEdging OH_Drawing_FontGetEdging(const OH_Drawing_Font*); 436 437/** 438 * @brief Destroys an <b>OH_Drawing_Font</b> object and reclaims the memory occupied by the object. 439 * 440 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 441 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 442 * @since 11 443 * @version 1.0 444 */ 445void OH_Drawing_FontDestroy(OH_Drawing_Font*); 446 447/** 448 * @brief Defines a run, supplies storage for the metrics of an <b>OH_Drawing_Font</b>. 449 * 450 * @since 12 451 * @version 1.0 452 */ 453typedef struct OH_Drawing_Font_Metrics { 454 /** Indicating which metrics are valid */ 455 uint32_t flags; 456 /** storage for top in font metrics */ 457 float top; 458 /** storage for ascent in font metrics */ 459 float ascent; 460 /** storage for descent in font metrics */ 461 float descent; 462 /** storage for bottom in font metrics */ 463 float bottom; 464 /** storage for leading in font metrics */ 465 float leading; 466 /** Average character width, zero if unknown */ 467 float avgCharWidth; 468 /** Maximum character width, zero if unknown */ 469 float maxCharWidth; 470 /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ 471 float xMin; 472 /** Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts */ 473 float xMax; 474 /** Height of lower-case letter, zero if unknown, typically negative */ 475 float xHeight; 476 /** Height of an upper-case letter, zero if unknown, typically negative */ 477 float capHeight; 478 /** @brief Underline thickness */ 479 float underlineThickness; 480 /** Distance from baseline to top of stroke, typically positive */ 481 float underlinePosition; 482 /** Strikeout thickness */ 483 float strikeoutThickness; 484 /** Distance from baseline to bottom of stroke, typically negative */ 485 float strikeoutPosition; 486} OH_Drawing_Font_Metrics; 487 488/** 489 * @brief Obtains the metrics of a font. 490 * 491 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 492 * @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 493 * @param OH_Drawing_Font_Metrics Indicates the pointer to an <b>OH_Drawing_Font_Metrics</b> object. 494 * @return Returns a float variable that recommended spacing between lines. 495 * @since 12 496 * @version 1.0 497 */ 498float OH_Drawing_FontGetMetrics(OH_Drawing_Font*, OH_Drawing_Font_Metrics*); 499 500/** 501 * @brief Retrieves the bound rect for each glyph in glyph array. 502 * 503 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 504 * @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 505 * @param glyphs Indicates the array of glyph indices to be measured. 506 * @param count Indicates the number of glyphs. 507 * @param bounds The bound rect array for each glyph, returned to the caller. 508 * @return Returns the error code. 509 * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. 510 * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, glyphs 511 * and bounds is nullptr or count is 0. 512 * @since 14 513 * @version 1.0 514 */ 515OH_Drawing_ErrorCode OH_Drawing_FontGetBounds(const OH_Drawing_Font* font, const uint16_t* glyphs, uint32_t count, 516 OH_Drawing_Array* bounds); 517 518/** 519 * @brief Retrieves the path for specified Glyph. 520 * 521 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 522 * @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 523 * @param glyph glyph index to be obtained. 524 * @param path The path object, returned to the caller. 525 * @return Returns the error code. 526 * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. 527 * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, path 528 * is nullptr or glyph not exist. 529 * @since 14 530 * @version 1.0 531 */ 532OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, uint16_t glyph, 533 OH_Drawing_Path* path); 534 535/** 536 * @brief Get the text outline path. 537 * 538 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 539 * @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object. 540 * @param text Indicates the character storage encoded with text encoding. 541 * @param byteLength Indicates the text length in bytes. 542 * @param encoding <b>OH_Drawing_TextEncoding</b> Indicates the text encoding. 543 * @param x Indicates x coordinates of the text. 544 * @param y Indicates y coordinates of the text. 545 * @param path <b>OH_Drawing_Path</b> The path object, returned to the caller. 546 * @return Returns the error code. 547 * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. 548 * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, text or path is nullptr. 549 * @since 14 550 */ 551OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath(const OH_Drawing_Font* font, const void* text, size_t byteLength, 552 OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path); 553 554#ifdef __cplusplus 555} 556#endif 557/** @} */ 558#endif 559