1 /* 2 * Copyright (c) 2021-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_TEXT_TYPOGRAPHY_H 17 #define C_INCLUDE_DRAWING_TEXT_TYPOGRAPHY_H 18 19 /** 20 * @addtogroup Drawing 21 * @{ 22 * 23 * @brief Provides the 2D drawing capability. 24 * 25 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 26 * 27 * @since 8 28 * @version 1.0 29 */ 30 31 /** 32 * @file drawing_text_typography.h 33 * 34 * @brief Declares functions related to <b>typography</b> in the drawing module. 35 * 36 * @kit ArkGraphics2D 37 * @library libnative_drawing.so 38 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 39 * @since 8 40 * @version 1.0 41 */ 42 43 #ifdef __cplusplus 44 #include <cstdint> 45 #include <cstddef> 46 #else 47 #include <stdint.h> 48 #include <stddef.h> 49 #endif 50 #include "drawing_canvas.h" 51 #include "drawing_color.h" 52 #include "drawing_font.h" 53 #include "drawing_text_declaration.h" 54 #include "drawing_types.h" 55 56 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 61 /** 62 * @brief Enumerates text directions. 63 */ 64 enum OH_Drawing_TextDirection { 65 /** Right to left (RTL) */ 66 TEXT_DIRECTION_RTL, 67 /** Left to right (LTR) */ 68 TEXT_DIRECTION_LTR, 69 }; 70 71 /** 72 * @brief Enumerates text alignment modes. 73 */ 74 enum OH_Drawing_TextAlign { 75 /** Left-aligned */ 76 TEXT_ALIGN_LEFT, 77 /** Right-aligned */ 78 TEXT_ALIGN_RIGHT, 79 /** Center-aligned */ 80 TEXT_ALIGN_CENTER, 81 /** 82 * Justified, which means that each line (except the last line) is stretched so that every line has equal width, 83 * and the left and right margins are straight. 84 */ 85 TEXT_ALIGN_JUSTIFY, 86 /** 87 * <b>TEXT_ALIGN_START</b> achieves the same effect as <b>TEXT_ALIGN_LEFT</b> 88 * when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_LTR</b>; 89 * it achieves the same effect as <b>TEXT_ALIGN_RIGHT</b> 90 * when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_RTL</b>. 91 */ 92 TEXT_ALIGN_START, 93 /** 94 * <b>TEXT_ALIGN_END</b> achieves the same effect as <b>TEXT_ALIGN_RIGHT</b> 95 * when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_LTR</b>; 96 * it achieves the same effect as <b>TEXT_ALIGN_LEFT</b> 97 * when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_RTL</b>. 98 */ 99 TEXT_ALIGN_END, 100 }; 101 102 /** 103 * @brief Enumerates font weights. 104 */ 105 enum OH_Drawing_FontWeight { 106 /** Thin */ 107 FONT_WEIGHT_100, 108 /** Extra-light */ 109 FONT_WEIGHT_200, 110 /** Light */ 111 FONT_WEIGHT_300, 112 /** Normal/Regular */ 113 FONT_WEIGHT_400, 114 /** Medium*/ 115 FONT_WEIGHT_500, 116 /** Semi-bold */ 117 FONT_WEIGHT_600, 118 /** Bold */ 119 FONT_WEIGHT_700, 120 /** Extra-bold */ 121 FONT_WEIGHT_800, 122 /** Black */ 123 FONT_WEIGHT_900, 124 }; 125 126 /** 127 * @brief Enumerates text baselines. 128 */ 129 enum OH_Drawing_TextBaseline { 130 /** Alphabetic, where the letters in alphabets like English sit on. */ 131 TEXT_BASELINE_ALPHABETIC, 132 /** Ideographic. The baseline is at the bottom of the text area. */ 133 TEXT_BASELINE_IDEOGRAPHIC, 134 }; 135 136 /** 137 * @brief Enumerates text decorations. 138 */ 139 enum OH_Drawing_TextDecoration { 140 /** No decoration. */ 141 TEXT_DECORATION_NONE = 0x0, 142 /** A underline is used for decoration. */ 143 TEXT_DECORATION_UNDERLINE = 0x1, 144 /** An overline is used for decoration. */ 145 TEXT_DECORATION_OVERLINE = 0x2, 146 /** A strikethrough is used for decoration. */ 147 TEXT_DECORATION_LINE_THROUGH = 0x4, 148 }; 149 150 /** 151 * @brief Enumerates font styles. 152 */ 153 enum OH_Drawing_FontStyle { 154 /** Normal style */ 155 FONT_STYLE_NORMAL, 156 /** Italic style */ 157 FONT_STYLE_ITALIC, 158 /** Oblique style */ 159 FONT_STYLE_OBLIQUE, 160 }; 161 162 /** 163 * @brief Enumerates placeholder vertical alignment. 164 * 165 * @since 11 166 * @version 1.0 167 */ 168 typedef enum { 169 /** Offset At Baseline */ 170 ALIGNMENT_OFFSET_AT_BASELINE, 171 /** Above Baseline */ 172 ALIGNMENT_ABOVE_BASELINE, 173 /** Below Baseline */ 174 ALIGNMENT_BELOW_BASELINE, 175 /** Top of Row Box */ 176 ALIGNMENT_TOP_OF_ROW_BOX, 177 /** Bottom of Row Box */ 178 ALIGNMENT_BOTTOM_OF_ROW_BOX, 179 /** Center of Row Box */ 180 ALIGNMENT_CENTER_OF_ROW_BOX, 181 } OH_Drawing_PlaceholderVerticalAlignment; 182 183 /** 184 * @brief Defines the placeholder span. 185 * 186 * @since 11 187 * @version 1.0 188 */ 189 typedef struct { 190 /** width of placeholder */ 191 double width; 192 /** height of placeholder */ 193 double height; 194 /** alignment of placeholder */ 195 OH_Drawing_PlaceholderVerticalAlignment alignment; 196 /** baseline of placeholder */ 197 OH_Drawing_TextBaseline baseline; 198 /** baselineoffset of placeholder */ 199 double baselineOffset; 200 } OH_Drawing_PlaceholderSpan; 201 202 /** 203 * @brief Enumerates text decoration style. 204 * 205 * @since 11 206 * @version 1.0 207 */ 208 typedef enum { 209 /** Solid style */ 210 TEXT_DECORATION_STYLE_SOLID, 211 /** Double style */ 212 TEXT_DECORATION_STYLE_DOUBLE, 213 /** Dotted style */ 214 TEXT_DECORATION_STYLE_DOTTED, 215 /** Dashed style */ 216 TEXT_DECORATION_STYLE_DASHED, 217 /** Wavy style */ 218 TEXT_DECORATION_STYLE_WAVY, 219 } OH_Drawing_TextDecorationStyle; 220 221 /** 222 * @brief Enumerates ellipsis modal. 223 * 224 * @since 11 225 * @version 1.0 226 */ 227 typedef enum { 228 /** Head modal */ 229 ELLIPSIS_MODAL_HEAD = 0, 230 /** Middle modal */ 231 ELLIPSIS_MODAL_MIDDLE = 1, 232 /** Tail modal */ 233 ELLIPSIS_MODAL_TAIL = 2, 234 } OH_Drawing_EllipsisModal; 235 236 /** 237 * @brief Enumerates break strategy. 238 * 239 * @since 11 240 * @version 1.0 241 */ 242 typedef enum { 243 /** Greedy strategy */ 244 BREAK_STRATEGY_GREEDY = 0, 245 /** Quality strategy */ 246 BREAK_STRATEGY_HIGH_QUALITY = 1, 247 /** Balanced strategy */ 248 BREAK_STRATEGY_BALANCED = 2, 249 } OH_Drawing_BreakStrategy; 250 251 /** 252 * @brief Enumerates word break type. 253 * 254 * @since 11 255 * @version 1.0 256 */ 257 typedef enum { 258 /** Normal type */ 259 WORD_BREAK_TYPE_NORMAL = 0, 260 /** Break All type */ 261 WORD_BREAK_TYPE_BREAK_ALL = 1, 262 /** Break Word type */ 263 WORD_BREAK_TYPE_BREAK_WORD = 2, 264 } OH_Drawing_WordBreakType; 265 266 /** 267 * @brief Enumerates rect height style. 268 * 269 * @since 11 270 * @version 1.0 271 */ 272 typedef enum { 273 /** Tight style */ 274 RECT_HEIGHT_STYLE_TIGHT, 275 /** Max style */ 276 RECT_HEIGHT_STYLE_MAX, 277 /** Includelinespacemiddle style */ 278 RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE, 279 /** Includelinespacetop style */ 280 RECT_HEIGHT_STYLE_INCLUDELINESPACETOP, 281 /** Includelinespacebottom style */ 282 RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM, 283 /** Struct style */ 284 RECT_HEIGHT_STYLE_STRUCT, 285 } OH_Drawing_RectHeightStyle; 286 287 /** 288 * @brief Enumerates rect Width style. 289 * 290 * @since 11 291 * @version 1.0 292 */ 293 typedef enum { 294 /** Tight style */ 295 RECT_WIDTH_STYLE_TIGHT, 296 /** Max style */ 297 RECT_WIDTH_STYLE_MAX, 298 } OH_Drawing_RectWidthStyle; 299 300 /** 301 * @brief Gets system font configuration information list result enum. 302 * 303 * @since 12 304 * @version 1.0 305 */ 306 enum OH_Drawing_FontConfigInfoErrorCode { 307 /** The list of system font configuration information was successfully obtained */ 308 SUCCESS_FONT_CONFIG_INFO = 0, 309 /** Unknown error */ 310 ERROR_FONT_CONFIG_INFO_UNKNOWN = 1, 311 /** Parse system config file error */ 312 ERROR_FONT_CONFIG_INFO_PARSE_FILE = 2, 313 /** Alloc memory error */ 314 ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY = 3, 315 /** Copy string data error */ 316 ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA = 4, 317 }; 318 319 /** 320 * @brief Fallback font information. 321 * 322 * @since 12 323 * @version 1.0 324 */ 325 typedef struct OH_Drawing_FontFallbackInfo { 326 /** The type of language supported by the font set. The language format is bcp47 */ 327 char* language; 328 /** Font family name */ 329 char* familyName; 330 } OH_Drawing_FontFallbackInfo; 331 332 /** 333 * @brief Fallback font group. 334 * 335 * @since 12 336 * @version 1.0 337 */ 338 typedef struct OH_Drawing_FontFallbackGroup { 339 /** 340 * The name of the font set corresponding to the fallback font set. If the value is null, 341 * all fonts can be set using the fallback font set list. 342 */ 343 char* groupName; 344 /** Fallback font Info Size */ 345 size_t fallbackInfoSize; 346 /** A list of font sets for fallback fonts */ 347 OH_Drawing_FontFallbackInfo* fallbackInfoSet; 348 } OH_Drawing_FontFallbackGroup; 349 350 /** 351 * @brief Font weight mapping information. 352 * 353 * @since 12 354 * @version 1.0 355 */ 356 typedef struct OH_Drawing_FontAdjustInfo { 357 /** The font's original weight value */ 358 int weight; 359 /** The font weight displayed in the application */ 360 int to; 361 } OH_Drawing_FontAdjustInfo; 362 363 /** 364 * @brief Alias font information. 365 * 366 * @since 12 367 * @version 1.0 368 */ 369 typedef struct OH_Drawing_FontAliasInfo { 370 /** Font family name */ 371 char* familyName; 372 /** 373 * Font weight value. When the weight value is greater than 0, 374 * the font set contains only fonts with the specified weight. 375 * When the weight value is equal to 0, the font set contains all fonts. 376 */ 377 int weight; 378 } OH_Drawing_FontAliasInfo; 379 380 /** 381 * @brief General font set information supported by the system. 382 * 383 * @since 12 384 * @version 1.0 385 */ 386 typedef struct OH_Drawing_FontGenericInfo { 387 /** Font family name */ 388 char* familyName; 389 /** The size of alias font lists */ 390 size_t aliasInfoSize; 391 /** The size of font weight mapping information lists */ 392 size_t adjustInfoSize; 393 /** List of alias fonts */ 394 OH_Drawing_FontAliasInfo* aliasInfoSet; 395 /** Font weight mapping information lists */ 396 OH_Drawing_FontAdjustInfo* adjustInfoSet; 397 } OH_Drawing_FontGenericInfo; 398 399 /** 400 * @brief System font configuration information. 401 * 402 * @since 12 403 * @version 1.0 404 */ 405 typedef struct OH_Drawing_FontConfigInfo { 406 /** Count of system font file paths */ 407 size_t fontDirSize; 408 /** List size of generic font sets */ 409 size_t fontGenericInfoSize; 410 /** Count of fallback font set lists */ 411 size_t fallbackGroupSize; 412 /** List of system font file paths */ 413 char** fontDirSet; 414 /** List of generic font sets */ 415 OH_Drawing_FontGenericInfo* fontGenericInfoSet; 416 /** List of fallback font sets */ 417 OH_Drawing_FontFallbackGroup* fallbackGroupSet; 418 } OH_Drawing_FontConfigInfo; 419 420 /** 421 * @brief Describes the font information. 422 * 423 * @since 12 424 * @version 1.0 425 */ 426 typedef struct OH_Drawing_FontDescriptor { 427 /** The file path of System font */ 428 char* path; 429 /** A name that uniquely identifies the font */ 430 char* postScriptName; 431 /** The name of System font */ 432 char* fullName; 433 /** The family of System font */ 434 char* fontFamily; 435 /** The subfont family of the system font */ 436 char* fontSubfamily; 437 /** The weight of System font */ 438 int weight; 439 /** The width of System font */ 440 int width; 441 /** Whether the system font is tilted */ 442 int italic; 443 /** Whether the system font is compact */ 444 bool monoSpace; 445 /** whether symbolic fonts are supported */ 446 bool symbolic; 447 } OH_Drawing_FontDescriptor; 448 449 /** 450 * @brief The metrics of line. 451 * 452 * @since 12 453 * @version 1.0 454 */ 455 typedef struct OH_Drawing_LineMetrics { 456 /** Text ascender height */ 457 double ascender; 458 /** Tex descender height */ 459 double descender; 460 /** The height of a capital letter */ 461 double capHeight; 462 /** The height of a lowercase letter */ 463 double xHeight; 464 /** Text width */ 465 double width; 466 /** Line height */ 467 double height; 468 /** 469 * The distance from the left end of the text to the left end of the container, 470 * aligned to 0, is the width of the container minus the width of the line of text 471 */ 472 double x; 473 /** 474 * The height from the top of the text to the top of the container, the first line is 0, 475 * and the second line is the height of the first line 476 */ 477 double y; 478 /** Start Index */ 479 size_t startIndex; 480 /** End Index */ 481 size_t endIndex; 482 /** The metrics information of the first character */ 483 OH_Drawing_Font_Metrics firstCharMetrics; 484 } OH_Drawing_LineMetrics; 485 486 /** 487 * @brief Enumerates of heightmode of text. 488 * 489 * @since 12 490 * @version 1.0 491 */ 492 enum OH_Drawing_TextHeightBehavior { 493 /** both ascend of first row and last row style */ 494 TEXT_HEIGHT_ALL = 0x0, 495 /** forbidding ascend of first row style*/ 496 TEXT_HEIGHT_DISABLE_FIRST_ASCENT = 0x1, 497 /** forbidding ascend of last row style */ 498 TEXT_HEIGHT_DISABLE_LAST_ASCENT = 0x2, 499 /** neither ascend of first row nor last row style */ 500 TEXT_HEIGHT_DISABLE_ALL = 0x1 | 0x2, 501 }; 502 503 /** 504 * @brief Enumerates text style type. 505 * 506 * @since 12 507 * @version 1.0 508 */ 509 enum OH_Drawing_TextStyleType { 510 /** None style */ 511 TEXT_STYLE_NONE, 512 /** All attributes style */ 513 TEXT_STYLE_ALL_ATTRIBUTES, 514 /** Font style */ 515 TEXT_STYLE_FONT, 516 /** Foreground style */ 517 TEXT_STYLE_FOREGROUND, 518 /** Background style */ 519 TEXT_STYLE_BACKGROUND, 520 /** Shadow style */ 521 TEXT_STYLE_SHADOW, 522 /** Decorations style */ 523 TEXT_STYLE_DECORATIONS, 524 /** Letter spacing style */ 525 TEXT_STYLE_LETTER_SPACING, 526 /** Word spacing style */ 527 TEXT_STYLE_WORD_SPACING 528 }; 529 530 /** 531 * @brief Enumerates font width. 532 * 533 * @since 12 534 * @version 1.0 535 */ 536 enum OH_Drawing_FontWidth { 537 /* Ultra condensed font width */ 538 FONT_WIDTH_ULTRA_CONDENSED = 1, 539 /* Extra condensed font width */ 540 FONT_WIDTH_EXTRA_CONDENSED = 2, 541 /* condensed font width */ 542 FONT_WIDTH_CONDENSED = 3, 543 /* Semi condensed font width */ 544 FONT_WIDTH_SEMI_CONDENSED = 4, 545 /* Normal font width */ 546 FONT_WIDTH_NORMAL = 5, 547 /* Semi expanded font width */ 548 FONT_WIDTH_SEMI_EXPANDED = 6, 549 /* Expanded font width */ 550 FONT_WIDTH_EXPANDED = 7, 551 /* Extra expanded font width */ 552 FONT_WIDTH_EXTRA_EXPANDED = 8, 553 /* Ultra expanded font width */ 554 FONT_WIDTH_ULTRA_EXPANDED = 9, 555 }; 556 557 /** 558 * @brief Defines the font style struct. 559 * 560 * @since 12 561 * @version 1.0 562 */ 563 typedef struct OH_Drawing_FontStyleStruct { 564 /** Font weight */ 565 OH_Drawing_FontWeight weight; 566 /** Font width */ 567 OH_Drawing_FontWidth width; 568 /** Font slant */ 569 OH_Drawing_FontStyle slant; 570 } OH_Drawing_FontStyleStruct; 571 572 /** 573 * @brief Defines the fontfeature. 574 * 575 * @since 12 576 * @version 1.0 577 */ 578 typedef struct { 579 /** key of fontfeature */ 580 char* tag; 581 /** value of fontfeature */ 582 int value; 583 } OH_Drawing_FontFeature; 584 585 /** 586 * @brief Defines StrutStyle info struct. 587 * 588 * @since 12 589 * @version 1.0 590 */ 591 typedef struct { 592 /** The font weight to use when calculating the strut */ 593 OH_Drawing_FontWeight weight; 594 /** The font style to use when calculating the strut */ 595 OH_Drawing_FontStyle style; 596 /** The size of the ascent plus descent in logical pixels */ 597 double size; 598 /** The minimum height of the strut, as a multiple of fontSize */ 599 double heightScale; 600 /** Whether the height is override */ 601 bool heightOverride; 602 /** Whether the halfleading is enable */ 603 bool halfLeading; 604 /** The additional leading to apply to the strut as a multiple of Size */ 605 double leading; 606 /** Whether the strut height should be forced */ 607 bool forceStrutHeight; 608 /** The size of font families */ 609 size_t familiesSize; 610 /** The families of the font to use when calculating the strut */ 611 char** families; 612 } OH_Drawing_StrutStyle; 613 614 /** 615 * @brief Creates an <b>OH_Drawing_TypographyStyle</b> object. 616 * 617 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 618 * @return Returns the pointer to the <b>OH_Drawing_TypographyStyle</b> object created. 619 * @since 8 620 * @version 1.0 621 */ 622 OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle(void); 623 624 /** 625 * @brief Releases the memory occupied by an <b>OH_Drawing_TypographyStyle</b> object. 626 * 627 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 628 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 629 * @since 8 630 * @version 1.0 631 */ 632 void OH_Drawing_DestroyTypographyStyle(OH_Drawing_TypographyStyle*); 633 634 /** 635 * @brief Sets the text direction. 636 * 637 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 638 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 639 * @param int Indicates the text direction to set. For details, see the enum <b>OH_Drawing_TextDirection</b>. 640 * @since 8 641 * @version 1.0 642 */ 643 void OH_Drawing_SetTypographyTextDirection(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextDirection */); 644 645 /** 646 * @brief Sets the text alignment mode. 647 * 648 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 649 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 650 * @param int Indicates the text alignment mode to set. For details, see the enum <b>OH_Drawing_TextAlign</b>. 651 * @since 8 652 * @version 1.0 653 */ 654 void OH_Drawing_SetTypographyTextAlign(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */); 655 656 /** 657 * @brief Sets the maximum number of lines in a text file. 658 * 659 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 660 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 661 * @param int Indicates the maximum number of lines to set. 662 * @since 8 663 * @version 1.0 664 */ 665 void OH_Drawing_SetTypographyTextMaxLines(OH_Drawing_TypographyStyle*, int /* maxLines */); 666 667 /** 668 * @brief Creates an <b>OH_Drawing_TextStyle</b> object. 669 * 670 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 671 * @return Returns the pointer to the <b>OH_Drawing_TextStyle</b> object created. 672 * @since 8 673 * @version 1.0 674 */ 675 OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle(void); 676 677 /** 678 * @brief Releases the memory occupied by an <b>OH_Drawing_TextStyle</b> object. 679 * 680 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 681 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 682 * @since 8 683 * @version 1.0 684 */ 685 void OH_Drawing_DestroyTextStyle(OH_Drawing_TextStyle*); 686 687 /** 688 * @brief Sets the text color. 689 * 690 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 691 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 692 * @param uint32_t Indicates the color to set. 693 * @since 8 694 * @version 1.0 695 */ 696 void OH_Drawing_SetTextStyleColor(OH_Drawing_TextStyle*, uint32_t /* color */); 697 698 /** 699 * @brief Sets the font size. 700 * 701 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 702 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 703 * @param double Indicates the font size to set. 704 * @since 8 705 * @version 1.0 706 */ 707 void OH_Drawing_SetTextStyleFontSize(OH_Drawing_TextStyle*, double /* fontSize */); 708 709 /** 710 * @brief Sets the font weight. 711 * 712 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 713 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 714 * @param int Indicates the font weight to set. For details, see the enum <b>OH_Drawing_FontWeight</b>. 715 * @since 8 716 * @version 1.0 717 */ 718 void OH_Drawing_SetTextStyleFontWeight(OH_Drawing_TextStyle*, int /* OH_Drawing_FontWeight */); 719 720 /** 721 * @brief Sets the text baseline. 722 * 723 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 724 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 725 * @param int Indicates the text baseline to set. For details, see the enum <b>OH_Drawing_TextBaseline</b>. 726 * @since 8 727 * @version 1.0 728 */ 729 void OH_Drawing_SetTextStyleBaseLine(OH_Drawing_TextStyle*, int /* OH_Drawing_TextBaseline */); 730 731 /** 732 * @brief Sets the text decoration. 733 * 734 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 735 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 736 * @param int Indicates the text decoration to set. For details, see the enum <b>OH_Drawing_TextDecoration</b>. 737 * @since 8 738 * @version 1.0 739 */ 740 void OH_Drawing_SetTextStyleDecoration(OH_Drawing_TextStyle*, int /* OH_Drawing_TextDecoration */); 741 742 /** 743 * @brief Sets the color for the text decoration. 744 * 745 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 746 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 747 * @param uint32_t Indicates the color to set. 748 * @since 8 749 * @version 1.0 750 */ 751 void OH_Drawing_SetTextStyleDecorationColor(OH_Drawing_TextStyle*, uint32_t /* color */); 752 753 /** 754 * @brief Sets the font height. 755 * 756 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 757 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 758 * @param double Indicates the font height to set. 759 * @since 8 760 * @version 1.0 761 */ 762 void OH_Drawing_SetTextStyleFontHeight(OH_Drawing_TextStyle*, double /* fontHeight */); 763 764 /** 765 * @brief Sets the font families. 766 * 767 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 768 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 769 * @param int Indicates the number of font families to set. 770 * @param char Indicates the pointer to the font families to set. 771 * @since 8 772 * @version 1.0 773 */ 774 void OH_Drawing_SetTextStyleFontFamilies(OH_Drawing_TextStyle*, 775 int /* fontFamiliesNumber */, const char* fontFamilies[]); 776 777 /** 778 * @brief Sets the font style. 779 * 780 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 781 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 782 * @param int Indicates the font style to set. For details, see the enum <b>OH_Drawing_FontStyle</b>. 783 * @since 8 784 * @version 1.0 785 */ 786 void OH_Drawing_SetTextStyleFontStyle(OH_Drawing_TextStyle*, int /* OH_Drawing_FontStyle */); 787 788 /** 789 * @brief Sets the locale. 790 * 791 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 792 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 793 * @param char Indicates the pointer to the locale to set. 794 * @since 8 795 * @version 1.0 796 */ 797 void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle*, const char*); 798 799 /** 800 * @brief Sets the foreground brush style. 801 * 802 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 803 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 804 * @param OH_Drawing_Brush Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>. 805 * @since 12 806 * @version 1.0 807 */ 808 void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); 809 810 /** 811 * @brief Gets the foreground brush style. 812 * 813 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 814 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 815 * @param OH_Drawing_Brush Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>. 816 * @since 12 817 * @version 1.0 818 */ 819 void OH_Drawing_TextStyleGetForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); 820 821 /** 822 * @brief Sets the foreground pen style. 823 * 824 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 825 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 826 * @param OH_Drawing_Pen Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>. 827 * @since 12 828 * @version 1.0 829 */ 830 void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); 831 832 /** 833 * @brief Gets the foreground pen style. 834 * 835 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 836 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 837 * @param OH_Drawing_Pen Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>. 838 * @since 12 839 * @version 1.0 840 */ 841 void OH_Drawing_TextStyleGetForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); 842 843 /** 844 * @brief Sets the background brush style. 845 * 846 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 847 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 848 * @param OH_Drawing_Brush Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>. 849 * @since 12 850 * @version 1.0 851 */ 852 void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); 853 854 /** 855 * @brief Gets the background brush style. 856 * 857 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 858 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 859 * @param OH_Drawing_Brush Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>. 860 * @since 12 861 * @version 1.0 862 */ 863 void OH_Drawing_TextStyleGetBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); 864 865 /** 866 * @brief Sets the background pen style. 867 * 868 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 869 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 870 * @param OH_Drawing_Pen Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>. 871 * @since 12 872 * @version 1.0 873 */ 874 void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); 875 876 /** 877 * @brief Gets the background pen style. 878 * 879 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 880 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 881 * @param OH_Drawing_Pen Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>. 882 * @since 12 883 * @version 1.0 884 */ 885 void OH_Drawing_TextStyleGetBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); 886 887 /** 888 * @brief Creates a pointer to an <b>OH_Drawing_TypographyCreate</b> object. 889 * 890 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 891 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 892 * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object. 893 * @return Returns the pointer to the <b>OH_Drawing_TypographyCreate</b> object created. 894 * @since 8 895 * @version 1.0 896 */ 897 OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler(OH_Drawing_TypographyStyle*, 898 OH_Drawing_FontCollection*); 899 900 /** 901 * @brief Releases the memory occupied by an <b>OH_Drawing_TypographyCreate</b> object. 902 * 903 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 904 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 905 * @since 8 906 * @version 1.0 907 */ 908 void OH_Drawing_DestroyTypographyHandler(OH_Drawing_TypographyCreate*); 909 910 /** 911 * @brief Sets the text style. 912 * 913 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 914 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 915 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 916 * @since 8 917 * @version 1.0 918 */ 919 void OH_Drawing_TypographyHandlerPushTextStyle(OH_Drawing_TypographyCreate*, OH_Drawing_TextStyle*); 920 921 /** 922 * @brief Sets the text content. 923 * 924 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 925 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 926 * @param char Indicates the pointer to the text content to set. 927 * @since 8 928 * @version 1.0 929 */ 930 void OH_Drawing_TypographyHandlerAddText(OH_Drawing_TypographyCreate*, const char*); 931 932 /** 933 * @brief Removes the topmost style in the stack, leaving the remaining styles in effect. 934 * 935 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 936 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 937 * @since 8 938 * @version 1.0 939 */ 940 void OH_Drawing_TypographyHandlerPopTextStyle(OH_Drawing_TypographyCreate*); 941 942 /** 943 * @brief Creates an <b>OH_Drawing_Typography</b> object. 944 * 945 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 946 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 947 * @return Returns the pointer to the <b>OH_Drawing_Typography</b> object created. 948 * @since 8 949 * @version 1.0 950 */ 951 OH_Drawing_Typography* OH_Drawing_CreateTypography(OH_Drawing_TypographyCreate*); 952 953 /** 954 * @brief Releases the memory occupied by an <b>OH_Drawing_Typography</b> object. 955 * 956 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 957 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 958 * @since 8 959 * @version 1.0 960 */ 961 void OH_Drawing_DestroyTypography(OH_Drawing_Typography*); 962 963 /** 964 * @brief Lays out the typography. 965 * 966 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 967 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 968 * @param double Indicates the maximum text width to set. 969 * @since 8 970 * @version 1.0 971 */ 972 void OH_Drawing_TypographyLayout(OH_Drawing_Typography*, double /* maxWidth */); 973 974 /** 975 * @brief Paints text on the canvas. 976 * 977 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 978 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 979 * @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object. 980 * @param double Indicates the x coordinate. 981 * @param double Indicates the y coordinate. 982 * @since 8 983 * @version 1.0 984 */ 985 void OH_Drawing_TypographyPaint(OH_Drawing_Typography*, OH_Drawing_Canvas*, 986 double /* potisionX */, double /* potisionY */); 987 988 /** 989 * @brief Paints path text on the canvas. 990 * 991 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 992 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 993 * @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object. 994 * @param OH_Drawing_Path Indicates path information. 995 * @param double Indicates the distance along the path to add to the text's starting position. 996 * @param double Indicates the distance above(-) or below(+) the path to position the text. 997 * @since 12 998 * @version 1.0 999 */ 1000 void OH_Drawing_TypographyPaintOnPath(OH_Drawing_Typography*, OH_Drawing_Canvas*, OH_Drawing_Path*, 1001 double /* hOffset */, double /* vOffset */); 1002 1003 /** 1004 * @brief Gets the max width. 1005 * 1006 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1007 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1008 * @return Returns the max width. 1009 * @since 9 1010 * @version 1.1 1011 */ 1012 double OH_Drawing_TypographyGetMaxWidth(OH_Drawing_Typography*); 1013 1014 /** 1015 * @brief Gets the height. 1016 * 1017 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1018 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1019 * @return Returns the height. 1020 * @since 9 1021 * @version 1.1 1022 */ 1023 double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*); 1024 1025 /** 1026 * @brief Gets the longest line. 1027 * 1028 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1029 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1030 * @return Returns the length of the longest line. 1031 * @since 9 1032 * @version 1.1 1033 */ 1034 double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); 1035 1036 /** 1037 * @brief Obtains the width of the longest line with indent. You are advised to 1038 * round up the return value in actual use. When the text content is empty, the 1039 * minimum float value, that is, 0.0, is returned. 1040 * 1041 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1042 * @param OH_Drawing_Typography Pointer to an <b>OH_Drawing_Typography</b> object, which is obtained by 1043 * {@link OH_Drawing_CreateTypography}. 1044 * @return Returns the width of the longest line with indent. 1045 * @since 13 1046 * @version 1.1 1047 */ 1048 double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); 1049 1050 /** 1051 * @brief Gets the min intrinsic width. 1052 * 1053 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1054 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1055 * @return Returns the min intrinsic width. 1056 * @since 9 1057 * @version 1.1 1058 */ 1059 double OH_Drawing_TypographyGetMinIntrinsicWidth(OH_Drawing_Typography*); 1060 1061 /** 1062 * @brief Gets the max intrinsic width. 1063 * 1064 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1065 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1066 * @return Returns the max intrinsic width. 1067 * @since 9 1068 * @version 1.1 1069 */ 1070 double OH_Drawing_TypographyGetMaxIntrinsicWidth(OH_Drawing_Typography*); 1071 1072 /** 1073 * @brief Gets the alphabetic baseline. 1074 * 1075 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1076 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1077 * @return Returns the alphabetic baseline. 1078 * @since 9 1079 * @version 1.1 1080 */ 1081 double OH_Drawing_TypographyGetAlphabeticBaseline(OH_Drawing_Typography*); 1082 1083 /** 1084 * @brief Gets the ideographic baseline. 1085 * 1086 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1087 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1088 * @return Returns the ideographic baseline. 1089 * @since 9 1090 * @version 1.1 1091 */ 1092 double OH_Drawing_TypographyGetIdeographicBaseline(OH_Drawing_Typography*); 1093 1094 /** 1095 * @brief Sets the placeholder. 1096 * 1097 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1098 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 1099 * @param OH_Drawing_PlaceholderSpan Indicates the pointer to an <b>OH_Drawing_PlaceholderSpan</b> object. 1100 * @since 11 1101 * @version 1.0 1102 */ 1103 void OH_Drawing_TypographyHandlerAddPlaceholder(OH_Drawing_TypographyCreate*, OH_Drawing_PlaceholderSpan*); 1104 1105 /** 1106 * @brief Gets the exceed maxLines. 1107 * 1108 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1109 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1110 * @return Returns the exceed maxLines. 1111 * @since 11 1112 * @version 1.0 1113 */ 1114 bool OH_Drawing_TypographyDidExceedMaxLines(OH_Drawing_Typography*); 1115 1116 /** 1117 * @brief Gets the rects for range. 1118 * 1119 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1120 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1121 * @param size_t Indicates the start of range to set. 1122 * @param size_t Indicates the end of range to set. 1123 * @param OH_Drawing_RectHeightStyle Indicates the height style to set. 1124 * For details, see the enum <b>OH_Drawing_RectHeightStyle</b>. 1125 * @param OH_Drawing_RectWidthStyle Indicates the width style to set. 1126 * For details, see the enum <b>OH_Drawing_RectWidthStyle</b>. 1127 * @return Returns the rects for range. 1128 * @since 11 1129 * @version 1.0 1130 */ 1131 OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForRange(OH_Drawing_Typography*, 1132 size_t, size_t, OH_Drawing_RectHeightStyle, OH_Drawing_RectWidthStyle); 1133 1134 /** 1135 * @brief Gets the rects for placeholders. 1136 * 1137 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1138 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1139 * @return Returns the rects for placeholders. 1140 * @since 11 1141 * @version 1.0 1142 */ 1143 OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForPlaceholders(OH_Drawing_Typography*); 1144 1145 /** 1146 * @brief Gets left from textbox. 1147 * 1148 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1149 * @param OH_Drawing_TextBox Indicates the pointer to an <b>OH_Drawing_TextBox</b> object. 1150 * @param int Indicates the index of textbox. 1151 * @return Returns left from textbox. 1152 * @since 11 1153 * @version 1.0 1154 */ 1155 float OH_Drawing_GetLeftFromTextBox(OH_Drawing_TextBox*, int); 1156 1157 /** 1158 * @brief Gets right from textbox. 1159 * 1160 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1161 * @param OH_Drawing_TextBox Indicates the pointer to an <b>OH_Drawing_TextBox</b> object. 1162 * @param int Indicates the index of textbox. 1163 * @return Returns right from textbox. 1164 * @since 11 1165 * @version 1.0 1166 */ 1167 float OH_Drawing_GetRightFromTextBox(OH_Drawing_TextBox*, int); 1168 1169 /** 1170 * @brief Gets top from textbox. 1171 * 1172 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1173 * @param OH_Drawing_TextBox Indicates the pointer to an <b>OH_Drawing_TextBox</b> object. 1174 * @param int Indicates the index of textbox. 1175 * @return Returns top from textbox. 1176 * @since 11 1177 * @version 1.0 1178 */ 1179 float OH_Drawing_GetTopFromTextBox(OH_Drawing_TextBox*, int); 1180 1181 /** 1182 * @brief Gets bottom from textbox. 1183 * 1184 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1185 * @param OH_Drawing_TextBox Indicates the pointer to an <b>OH_Drawing_TextBox</b> object. 1186 * @param int Indicates the index of textbox. 1187 * @return Returns bottom from textbox. 1188 * @since 11 1189 * @version 1.0 1190 */ 1191 float OH_Drawing_GetBottomFromTextBox(OH_Drawing_TextBox*, int); 1192 1193 /** 1194 * @brief Gets direction from textbox. 1195 * 1196 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1197 * @param OH_Drawing_TextBox Indicates the pointer to an <b>OH_Drawing_TextBox</b> object. 1198 * @param int Indicates the index of textbox. 1199 * @return Returns direction from textbox. 1200 * @since 11 1201 * @version 1.0 1202 */ 1203 int OH_Drawing_GetTextDirectionFromTextBox(OH_Drawing_TextBox*, int); 1204 1205 /** 1206 * @brief Gets size of textbox. 1207 * 1208 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1209 * @param OH_Drawing_TextBox Indicates the pointer to an <b>OH_Drawing_TextBox</b> object. 1210 * @return Returns size of textbox. 1211 * @since 11 1212 * @version 1.0 1213 */ 1214 size_t OH_Drawing_GetSizeOfTextBox(OH_Drawing_TextBox*); 1215 1216 /** 1217 * @brief Gets the glyphposition at coordinate. 1218 * 1219 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1220 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1221 * @param double Indicates the positionX of typography to set. 1222 * @param double Indicates the positionY of typography to set. 1223 * @return Returns the glyphposition at coordinate. 1224 * @since 11 1225 * @version 1.0 1226 */ 1227 OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinate(OH_Drawing_Typography*, 1228 double, double); 1229 1230 /** 1231 * @brief Gets the glyphposition at coordinate with cluster. 1232 * 1233 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1234 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1235 * @param double Indicates the positionX of typography to set. 1236 * @param double Indicates the positionY of typography to set. 1237 * @return Returns the glyphposition at coordinate with cluster. 1238 * @since 11 1239 * @version 1.0 1240 */ 1241 OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster(OH_Drawing_Typography*, 1242 double, double); 1243 1244 /** 1245 * @brief Gets position from position and affinity. 1246 * 1247 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1248 * @param OH_Drawing_PositionAndAffinity Indicates the pointer to an <b>OH_Drawing_PositionAndAffinity</b> object. 1249 * @return Returns position from position and affinity. 1250 * @since 11 1251 * @version 1.0 1252 */ 1253 size_t OH_Drawing_GetPositionFromPositionAndAffinity(OH_Drawing_PositionAndAffinity*); 1254 1255 /** 1256 * @brief Gets affinity from position and affinity. 1257 * 1258 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1259 * @param OH_Drawing_PositionAndAffinity Indicates the pointer to an <b>OH_Drawing_PositionAndAffinity</b> object. 1260 * @return Returns affinity from position and affinity. 1261 * @since 11 1262 * @version 1.0 1263 */ 1264 int OH_Drawing_GetAffinityFromPositionAndAffinity(OH_Drawing_PositionAndAffinity*); 1265 1266 /** 1267 * @brief Gets the word boundary. 1268 * 1269 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1270 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1271 * @param size_t Indicates the size of text to set. 1272 * @return Returns the word boundary. 1273 * @since 11 1274 * @version 1.0 1275 */ 1276 OH_Drawing_Range* OH_Drawing_TypographyGetWordBoundary(OH_Drawing_Typography*, size_t); 1277 1278 /** 1279 * @brief Gets start from range. 1280 * 1281 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1282 * @param OH_Drawing_Range Indicates the pointer to an <b>OH_Drawing_Range</b> object. 1283 * @return Returns start from range. 1284 * @since 11 1285 * @version 1.0 1286 */ 1287 size_t OH_Drawing_GetStartFromRange(OH_Drawing_Range*); 1288 1289 /** 1290 * @brief Gets end from range. 1291 * 1292 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1293 * @param OH_Drawing_Range Indicates the pointer to an <b>OH_Drawing_Range</b> object. 1294 * @return Returns end from range. 1295 * @since 11 1296 * @version 1.0 1297 */ 1298 size_t OH_Drawing_GetEndFromRange(OH_Drawing_Range*); 1299 1300 /** 1301 * @brief Gets the line count. 1302 * 1303 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1304 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1305 * @return Returns the line count. 1306 * @since 11 1307 * @version 1.0 1308 */ 1309 size_t OH_Drawing_TypographyGetLineCount(OH_Drawing_Typography*); 1310 1311 /** 1312 * @brief Sets the decoration style. 1313 * 1314 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1315 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1316 * @param int Indicates the text decoration style to set. 1317 * For details, see the enum <b>OH_Drawing_TextDecorationStyle</b>. 1318 * @since 11 1319 * @version 1.0 1320 */ 1321 void OH_Drawing_SetTextStyleDecorationStyle(OH_Drawing_TextStyle*, int); 1322 1323 /** 1324 * @brief Sets the decoration thickness scale. 1325 * 1326 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1327 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1328 * @param double Indicates the thickness scale of text decoration to set. 1329 * @since 11 1330 * @version 1.0 1331 */ 1332 void OH_Drawing_SetTextStyleDecorationThicknessScale(OH_Drawing_TextStyle*, double); 1333 1334 /** 1335 * @brief Sets the letter spacing. 1336 * 1337 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1338 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1339 * @param double Indicates the letter space to set. 1340 * @since 11 1341 * @version 1.0 1342 */ 1343 void OH_Drawing_SetTextStyleLetterSpacing(OH_Drawing_TextStyle*, double); 1344 1345 /** 1346 * @brief Sets the word spacing. 1347 * 1348 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1349 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1350 * @param double Indicates the word space to set. 1351 * @since 11 1352 * @version 1.0 1353 */ 1354 void OH_Drawing_SetTextStyleWordSpacing(OH_Drawing_TextStyle*, double); 1355 1356 /** 1357 * @brief Sets the half leading. 1358 * 1359 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1360 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1361 * @param bool Indicates the half leading to set. 1362 * @since 11 1363 * @version 1.0 1364 */ 1365 void OH_Drawing_SetTextStyleHalfLeading(OH_Drawing_TextStyle*, bool); 1366 1367 /** 1368 * @brief Sets the ellipsis. 1369 * 1370 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1371 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1372 * @param char* Indicates the pointer to ellipsis style. 1373 * @since 11 1374 * @version 1.0 1375 */ 1376 void OH_Drawing_SetTextStyleEllipsis(OH_Drawing_TextStyle*, const char*); 1377 1378 /** 1379 * @brief Sets the ellipsis modal. 1380 * 1381 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1382 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 1383 * @param int Indicates the ellipsis model to set. For details, see the enum <b>OH_Drawing_EllipsisModal</b>. 1384 * @since 11 1385 * @version 1.0 1386 */ 1387 void OH_Drawing_SetTextStyleEllipsisModal(OH_Drawing_TextStyle*, int); 1388 1389 /** 1390 * @brief Sets the break strategy. 1391 * 1392 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1393 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 1394 * @param int Indicates the break strategy to set. For details, see the enum <b>OH_Drawing_BreakStrategy</b>. 1395 * @since 11 1396 * @version 1.0 1397 */ 1398 void OH_Drawing_SetTypographyTextBreakStrategy(OH_Drawing_TypographyStyle*, int); 1399 1400 /** 1401 * @brief Sets the word break type. 1402 * 1403 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1404 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 1405 * @param int Indicates the word break type to set. For details, see the enum <b>OH_Drawing_WordBreakType</b>. 1406 * @since 11 1407 * @version 1.0 1408 */ 1409 void OH_Drawing_SetTypographyTextWordBreakType(OH_Drawing_TypographyStyle*, int); 1410 1411 /** 1412 * @brief Sets the ellipsis modal. 1413 * 1414 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1415 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 1416 * @param int Indicates the ellipsis modal to set. For details, see the enum <b>OH_Drawing_EllipsisModal</b>. 1417 * @since 11 1418 * @version 1.0 1419 */ 1420 void OH_Drawing_SetTypographyTextEllipsisModal(OH_Drawing_TypographyStyle*, int); 1421 1422 /** 1423 * @brief get line height. 1424 * 1425 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1426 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1427 * @param int Indicates the line number. 1428 * @return Returns line height. 1429 * @since 11 1430 * @version 1.0 1431 */ 1432 double OH_Drawing_TypographyGetLineHeight(OH_Drawing_Typography*, int); 1433 1434 /** 1435 * @brief get line width. 1436 * 1437 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1438 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1439 * @param int Indicates the line number. 1440 * @return Returns line width. 1441 * @since 11 1442 * @version 1.0 1443 */ 1444 double OH_Drawing_TypographyGetLineWidth(OH_Drawing_Typography*, int); 1445 1446 /** 1447 * @brief get line text range. 1448 * 1449 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1450 * @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object. 1451 * @param int Indicates the line number. 1452 * @param bool Indicates whether spaces are contained. 1453 * @return Returns line text range. 1454 * @since 12 1455 * @version 1.0 1456 */ 1457 OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography*, int, bool); 1458 1459 /** 1460 * @brief Creates an <b>OH_Drawing_FontDescriptor</b> object. 1461 * 1462 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1463 * @return Returns the pointer to the font descriptor object <b>OH_Drawing_FontDescriptor</b> created. 1464 * @since 12 1465 * @version 1.0 1466 */ 1467 OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor(void); 1468 1469 /** 1470 * @brief Releases the memory occupied by an <b>OH_Drawing_FontDescriptor</b> object. 1471 * 1472 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1473 * @param OH_Drawing_FontDescriptor the pointer to the font descriptor object <b>OH_Drawing_FontDescriptor</b>. 1474 * @since 12 1475 * @version 1.0 1476 */ 1477 void OH_Drawing_DestroyFontDescriptor(OH_Drawing_FontDescriptor*); 1478 1479 /** 1480 * @brief Creates an <b>OH_Drawing_FontParser</b> object. 1481 * 1482 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1483 * @return Returns the pointer to the font parser object <b>OH_Drawing_FontParser</b>. 1484 * @since 12 1485 * @version 1.0 1486 */ 1487 OH_Drawing_FontParser* OH_Drawing_CreateFontParser(void); 1488 1489 /** 1490 * @brief Releases the memory occupied by an <b>OH_Drawing_FontParser</b> object. 1491 * 1492 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1493 * @param OH_Drawing_FontParser Indicates the pointer to the font parser object <b>OH_Drawing_FontParser</b>. 1494 * @since 12 1495 * @version 1.0 1496 */ 1497 void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser*); 1498 1499 /** 1500 * @brief Gets a list of system font names. 1501 * 1502 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1503 * @param OH_Drawing_FontParser Indicates the pointer to the font parser object <b>OH_Drawing_FontParser</b>. 1504 * @param size_t Returns the number of obtained system font names. 1505 * @return Returns a list of obtained system fonts. 1506 * @since 12 1507 * @version 1.0 1508 */ 1509 char** OH_Drawing_FontParserGetSystemFontList(OH_Drawing_FontParser*, size_t*); 1510 1511 /** 1512 * @brief Releases the memory occupied by a list of system font names. 1513 * 1514 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1515 * @param char** Indicates the pointer to a list of system font names. 1516 * @param size_t The number of obtained system font names. 1517 * @since 12 1518 * @version 1.0 1519 */ 1520 void OH_Drawing_DestroySystemFontList(char**, size_t); 1521 1522 /** 1523 * @brief Gets information about the system font by font name. 1524 * 1525 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1526 * @param OH_Drawing_FontParser Indicates the pointer to the font parser object <b>OH_Drawing_FontParser</b>. 1527 * @param char** font name. 1528 * @return Returns system fonts information. 1529 * @since 12 1530 * @version 1.0 1531 */ 1532 OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontParser*, const char*); 1533 1534 /** 1535 * @brief Get line metrics information. 1536 * 1537 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1538 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1539 * @return Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>. 1540 * @since 12 1541 * @version 1.0 1542 */ 1543 OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typography*); 1544 1545 /** 1546 * @brief Get the number of lines. 1547 * 1548 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1549 * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>. 1550 * @return Returns the number of lines. 1551 * @since 12 1552 * @version 1.0 1553 */ 1554 size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics*); 1555 1556 /** 1557 * @brief Releases the memory occupied by line metrics. 1558 * 1559 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1560 * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>. 1561 * @since 12 1562 * @version 1.0 1563 */ 1564 void OH_Drawing_DestroyLineMetrics(OH_Drawing_LineMetrics*); 1565 1566 /** 1567 * @brief Gets the specified line by line number. 1568 * 1569 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1570 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1571 * @param int Line number. 1572 * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>. 1573 * @return Whether the line metrics was obtained. 1574 * @since 12 1575 * @version 1.0 1576 */ 1577 bool OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography*, int, OH_Drawing_LineMetrics*); 1578 1579 /** 1580 * @brief Sets the ellipsis of lines in a text file. 1581 * 1582 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1583 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1584 * @param char Indicates the line textellipsis. 1585 * @since 12 1586 * @version 1.0 1587 */ 1588 void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle*, const char*); 1589 1590 /** 1591 * @brief Sets the locale of lines in a text file. 1592 * 1593 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1594 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1595 * <b>OH_Drawing_TypographyStyle</b>. 1596 * @param char Indicates the pointer to the locale to set. 1597 * @since 12 1598 * @version 1.0 1599 */ 1600 void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle*, const char*); 1601 1602 /** 1603 * @brief Sets the textSplitRatio of lines in a text file. 1604 * 1605 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1606 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1607 * <b>OH_Drawing_TypographyStyle</b>. 1608 * @param float Indicates the textSplitRatio of lines to set. 1609 * @since 12 1610 * @version 1.0 1611 */ 1612 void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); 1613 1614 /** 1615 * @brief Gets the TextStyle of lines in a text file. 1616 * 1617 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1618 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1619 * <b>OH_Drawing_TypographyStyle</b>. 1620 * @return Returns line text textstyle. 1621 * @since 12 1622 * @version 1.0 1623 */ 1624 OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographyStyle*); 1625 1626 /** 1627 * @brief Gets the EffectiveAlign of lines in a text file. 1628 * 1629 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1630 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1631 * <b>OH_Drawing_TypographyStyle</b>. 1632 * @return Returns line text align. 1633 * @since 12 1634 * @version 1.0 1635 */ 1636 int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); 1637 1638 /** 1639 * @brief Gets the UnlimitedLines of lines in a text file. 1640 * 1641 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1642 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1643 * <b>OH_Drawing_TypographyStyle</b>. 1644 * @return Returns whether the text has a maximum line limit, 1645 * with true indicating a maximum line limit and false indicating no maximum line limit. 1646 * @since 12 1647 * @version 1.0 1648 */ 1649 bool OH_Drawing_TypographyIsLineUnlimited(OH_Drawing_TypographyStyle*); 1650 1651 /** 1652 * @brief Gets the IsEllipsized of lines in a text file. 1653 * 1654 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1655 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1656 * <b>OH_Drawing_TypographyStyle</b>. 1657 * @return Returns whether the text has ellipsis, 1658 * true meaning there is an ellipsis and false meaning there is no ellipsis. 1659 * @since 12 1660 * @version 1.0 1661 */ 1662 bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle*); 1663 1664 /** 1665 * @brief set line textstyle. 1666 * 1667 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1668 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1669 * <b>OH_Drawing_TypographyStyle</b>. 1670 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1671 * @since 12 1672 * @version 1.0 1673 */ 1674 void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_TextStyle*); 1675 1676 /** 1677 * @brief get line fontmetrics. 1678 * 1679 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1680 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1681 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1682 * @param OH_Drawing_Font_Metrics Indicates the pointer to a font metrics object <b>OH_Drawing_Font_Metrics</b>. 1683 * @return Whether the font metrics was obtained. 1684 * @since 12 1685 * @version 1.0 1686 */ 1687 bool OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*, OH_Drawing_Font_Metrics*); 1688 1689 /** 1690 * @brief Gets the position of the specified line or the first text of the specified line. 1691 * 1692 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1693 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1694 * @param int Line number. 1695 * @param bool True is the information for the whole line, and false is the information to get the first character 1696 * @param bool Whether the text width contains whitespace. 1697 * @param OH_Drawing_LineMetrics Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>. 1698 * @return return whether the information was successfully fetched. 1699 * @since 12 1700 * @version 1.0 1701 */ 1702 bool OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool, OH_Drawing_LineMetrics*); 1703 1704 /** 1705 * @brief Sets the font weight of text typography. 1706 * 1707 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1708 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1709 * <b>OH_Drawing_TypographyStyle</b>. 1710 * @param int Indicates the font weight of text typography to set. For details, 1711 * see the enum <b>OH_Drawing_FontWeight</b>. 1712 * @since 12 1713 * @version 1.0 1714 */ 1715 void OH_Drawing_SetTypographyTextFontWeight(OH_Drawing_TypographyStyle*, int); 1716 1717 /** 1718 * @brief Sets the font style of text typography. 1719 * 1720 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1721 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1722 * <b>OH_Drawing_TypographyStyle</b>. 1723 * @param int Indicates the font style of text typography to set. For details, 1724 * see the enum <b>OH_Drawing_FontStyle</b>. 1725 * @since 12 1726 * @version 1.0 1727 */ 1728 void OH_Drawing_SetTypographyTextFontStyle(OH_Drawing_TypographyStyle*, int); 1729 1730 /** 1731 * @brief Sets the font family of text typography. 1732 * 1733 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1734 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1735 * <b>OH_Drawing_TypographyStyle</b>. 1736 * @param char Indicates the pointer to the font family of text typography to set. 1737 * @since 12 1738 * @version 1.0 1739 */ 1740 void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle*, const char*); 1741 1742 /** 1743 * @brief Sets the font size of text typography. 1744 * 1745 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1746 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1747 * <b>OH_Drawing_TypographyStyle</b>. 1748 * @param double Indicates the font size of text typography to set. 1749 * @since 12 1750 * @version 1.0 1751 */ 1752 void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle*, double); 1753 1754 /** 1755 * @brief Sets the font height of text typography. 1756 * 1757 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1758 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1759 * <b>OH_Drawing_TypographyStyle</b>. 1760 * @param double Indicates the font height of text typography to set. 1761 * @since 12 1762 * @version 1.0 1763 */ 1764 void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double); 1765 1766 /** 1767 * @brief Sets the half leading of text typography. 1768 * 1769 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1770 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1771 * <b>OH_Drawing_TypographyStyle</b>. 1772 * @param bool Indicates the half leading of text typography to set. 1773 * @since 12 1774 * @version 1.0 1775 */ 1776 void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle*, bool); 1777 1778 /** 1779 * @brief Sets whether to enable line style for text typography. 1780 * 1781 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1782 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1783 * <b>OH_Drawing_TypographyStyle</b>. 1784 * @param bool Indicates whether the line style for text typography is used. 1785 * @since 12 1786 * @version 1.0 1787 */ 1788 void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle*, bool); 1789 1790 /** 1791 * @brief Sets the font weight of line style for text typography. 1792 * 1793 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1794 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1795 * <b>OH_Drawing_TypographyStyle</b>. 1796 * @param int Indicates the font weight of line style for text typography to set. 1797 * For details, see the enum <b>OH_Drawing_FontWeight</b>. 1798 * @since 12 1799 * @version 1.0 1800 */ 1801 void OH_Drawing_SetTypographyTextLineStyleFontWeight(OH_Drawing_TypographyStyle*, int); 1802 1803 /** 1804 * @brief Sets the font style of line style for text typography. 1805 * 1806 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1807 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1808 * <b>OH_Drawing_TypographyStyle</b>. 1809 * @param int Indicates the font style of line style for text typography to set. For details, 1810 * see the enum <b>OH_Drawing_FontStyle</b>. 1811 * @since 12 1812 * @version 1.0 1813 */ 1814 void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle*, int); 1815 1816 /** 1817 * @brief Sets the font families of line style for text typography. 1818 * 1819 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1820 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1821 * <b>OH_Drawing_TypographyStyle</b>. 1822 * @param int Indicates the number of font families to set. 1823 * @param char Indicates the pointer to the font families of line style for text typography to set. 1824 * @since 12 1825 * @version 1.0 1826 */ 1827 void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyle*, int, const char* fontFamilies[]); 1828 1829 /** 1830 * @brief Sets the font size of line style for text typography. 1831 * 1832 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1833 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1834 * <b>OH_Drawing_TypographyStyle</b>. 1835 * @param double Indicates the font size of line style for text typography to set. 1836 * @since 12 1837 * @version 1.0 1838 */ 1839 void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle*, double); 1840 1841 /** 1842 * @brief Sets the font height of line style for text typography. 1843 * 1844 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1845 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1846 * <b>OH_Drawing_TypographyStyle</b>. 1847 * @param double Indicates the font height of line style for text typography to set. 1848 * @since 12 1849 * @version 1.0 1850 */ 1851 void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle*, double); 1852 1853 /** 1854 * @brief Sets the half leading of line style for text typography. 1855 * 1856 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1857 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1858 * <b>OH_Drawing_TypographyStyle</b>. 1859 * @param bool Indicates the half leading of line for text typography to set. 1860 * @since 12 1861 * @version 1.0 1862 */ 1863 void OH_Drawing_SetTypographyTextLineStyleHalfLeading(OH_Drawing_TypographyStyle*, bool); 1864 1865 /** 1866 * @brief Sets the spacing scale of line style for text typography. 1867 * 1868 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1869 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1870 * <b>OH_Drawing_TypographyStyle</b>. 1871 * @param double Indicates the space scale of line for text typography to set. 1872 * @since 12 1873 * @version 1.0 1874 */ 1875 void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyle*, double); 1876 1877 /** 1878 * @brief Sets whether only line style is enabled for text typography. 1879 * 1880 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1881 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 1882 * <b>OH_Drawing_TypographyStyle</b>. 1883 * @param bool Indicates the line style for text typography to set only. 1884 * @since 12 1885 * @version 1.0 1886 */ 1887 void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool); 1888 1889 /** 1890 * @brief Creates an <b>OH_Drawing_TextShadow</b> object. 1891 * 1892 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1893 * @return Returns the pointer to the text shadow object created <b>OH_Drawing_TextShadow</b>. 1894 * @since 12 1895 * @version 1.0 1896 */ 1897 OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow(void); 1898 1899 /** 1900 * @brief Releases the memory occupied by the text shadow object <b>OH_Drawing_TextShadow</b>. 1901 * 1902 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1903 * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>. 1904 * @since 12 1905 * @version 1.0 1906 */ 1907 void OH_Drawing_DestroyTextShadow(OH_Drawing_TextShadow*); 1908 1909 /** 1910 * @brief Gets the vector of TextShadow in TextStyle. 1911 * 1912 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1913 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1914 * @param int Indicates the number in vector to set. 1915 * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>. 1916 * @return Returns the vector of TextShadow. 1917 * @since 12 1918 * @version 1.0 1919 */ 1920 OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle*); 1921 1922 /** 1923 * @brief Gets the size of vector of TextShadow in TextStyle. 1924 * 1925 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1926 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1927 * @return Returns the size of vector. 1928 * @since 12 1929 * @version 1.0 1930 */ 1931 int OH_Drawing_TextStyleGetShadowCount(OH_Drawing_TextStyle*); 1932 1933 /** 1934 * @brief Adds element in vector of TextShadow in TextStyle. 1935 * 1936 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1937 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1938 * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>. 1939 * @since 12 1940 * @version 1.0 1941 */ 1942 void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle*, const OH_Drawing_TextShadow*); 1943 1944 /** 1945 * @brief clear elements in vector of TextShadow in TextStyle. 1946 * 1947 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1948 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1949 * @since 12 1950 * @version 1.0 1951 */ 1952 void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); 1953 1954 /** 1955 * @brief Gets element in vector of TextShadow with index. 1956 * 1957 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1958 * @param OH_Drawing_TextStyle Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>. 1959 * @param int Indicates the index to set. 1960 * @return Returns the pointer to element with the index in vector of the text style object 1961 * <b>OH_Drawing_TextStyle</b>. 1962 * @since 12 1963 * @version 1.0 1964 */ 1965 OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextStyle*, int); 1966 1967 /** 1968 * @brief Set indents of the typography. 1969 * 1970 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1971 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1972 * @param float Indicates the pointer to the indents to set. 1973 * @since 12 1974 * @version 1.0 1975 */ 1976 void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float indents[]); 1977 1978 /** 1979 * @brief Gets element with index in vector of Indents. 1980 * 1981 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1982 * @param OH_Drawing_Typography Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>. 1983 * @param int Indicates the index to set. 1984 * @return float Indicates the element with the index in vector of Indents. 1985 * @since 12 1986 * @version 1.0 1987 */ 1988 float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); 1989 1990 /** 1991 * @brief Releases the memory occupied by vector with the text shadow object <b>OH_Drawing_TextShadow</b>. 1992 * 1993 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 1994 * @param Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>. 1995 * @since 12 1996 * @version 1.0 1997 */ 1998 void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); 1999 2000 /** 2001 * @brief Set mode of applying the leading over and under text. 2002 * 2003 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2004 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2005 * @param heightMode Indicates the mode to set. 2006 * @since 12 2007 * @version 1.0 2008 */ 2009 void OH_Drawing_TypographyTextSetHeightBehavior(OH_Drawing_TypographyStyle*, OH_Drawing_TextHeightBehavior heightMode); 2010 2011 /** 2012 * @brief Get mode of applying the leading over and under text. 2013 * 2014 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2015 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2016 * @return Returns the mode. 2017 * @since 12 2018 * @version 1.0 2019 */ 2020 OH_Drawing_TextHeightBehavior OH_Drawing_TypographyTextGetHeightBehavior(OH_Drawing_TypographyStyle*); 2021 2022 /** 2023 * @brief Set struct of background rect and styleId of text. 2024 * 2025 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2026 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2027 * @param OH_Drawing_RectStyle_Info Indicates the pointer to an <b>OH_Drawing_RectStyle_Info</b> object. 2028 * @param styleId Indicates the styleId of text to set. 2029 * @since 12 2030 * @version 1.0 2031 */ 2032 void OH_Drawing_TextStyleSetBackgroundRect(OH_Drawing_TextStyle*, const OH_Drawing_RectStyle_Info*, int styleId); 2033 2034 /** 2035 * @brief Add symbols in creating typography. 2036 * 2037 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2038 * @param OH_Drawing_TypographyCreate Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object. 2039 * @param symbol Indicates the symbol to set. 2040 * @since 12 2041 * @version 1.0 2042 */ 2043 void OH_Drawing_TypographyHandlerAddSymbol(OH_Drawing_TypographyCreate*, uint32_t symbol); 2044 2045 /** 2046 * @brief Add font feature. 2047 * 2048 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2049 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2050 * @param tag Indicates the pointer to the tag to set. 2051 * @param value Indicates the value to set. 2052 * @since 12 2053 * @version 1.0 2054 */ 2055 void OH_Drawing_TextStyleAddFontFeature(OH_Drawing_TextStyle*, const char* tag, int value); 2056 2057 /** 2058 * @brief Add font variation. 2059 * 2060 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2061 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2062 * @param char* Indicates the pointer to font variation axis. 2063 * @param float Indicates the font variation value to set. 2064 * @since 12 2065 * @version 1.0 2066 */ 2067 void OH_Drawing_TextStyleAddFontVariation(OH_Drawing_TextStyle*, const char* /* axis */, const float /* value */); 2068 2069 /** 2070 * @brief Get all font features. 2071 * 2072 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2073 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2074 * @return OH_Drawing_FontFeature Indicates the pointer to an array of structures of OH_Drawing_FontFeature. 2075 * Get size of font feature by OH_Drawing_TextStyleGetFontFeatureSize. 2076 * @since 12 2077 * @version 1.0 2078 */ 2079 OH_Drawing_FontFeature* OH_Drawing_TextStyleGetFontFeatures(OH_Drawing_TextStyle*); 2080 2081 /** 2082 * @brief Release the memory occupied by array of structures of font features. 2083 * 2084 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2085 * @param OH_Drawing_FontFeature Indicates the pointer to an array of structures of OH_Drawing_FontFeature. 2086 * @param fontFeatureSize Indicates the size of array of structures of OH_Drawing_FontFeature. 2087 * @since 12 2088 * @version 1.0 2089 */ 2090 void OH_Drawing_TextStyleDestroyFontFeatures(OH_Drawing_FontFeature*, size_t fontFeatureSize); 2091 2092 /** 2093 * @brief Get size of font features. 2094 * 2095 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2096 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2097 * @return Returns the size of fontfeatures map. 2098 * @since 12 2099 * @version 1.0 2100 */ 2101 size_t OH_Drawing_TextStyleGetFontFeatureSize(OH_Drawing_TextStyle*); 2102 2103 /** 2104 * @brief Clear font features. 2105 * 2106 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2107 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2108 * @since 12 2109 * @version 1.0 2110 */ 2111 void OH_Drawing_TextStyleClearFontFeature(OH_Drawing_TextStyle*); 2112 2113 /** 2114 * @brief Set baseline shift of text. 2115 * 2116 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2117 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2118 * @param lineShift Indicates the baseline shift to set. 2119 * @since 12 2120 * @version 1.0 2121 */ 2122 void OH_Drawing_TextStyleSetBaselineShift(OH_Drawing_TextStyle*, double lineShift); 2123 2124 /** 2125 * @brief Get baseline shift of text. 2126 * 2127 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2128 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2129 * @return Returns the baseline shift. 2130 * @since 12 2131 * @version 1.0 2132 */ 2133 double OH_Drawing_TextStyleGetBaselineShift(OH_Drawing_TextStyle*); 2134 2135 /** 2136 * @brief Gets the text color. 2137 * 2138 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2139 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2140 * @return Returns the text color. 2141 * @since 12 2142 * @version 1.0 2143 */ 2144 uint32_t OH_Drawing_TextStyleGetColor(OH_Drawing_TextStyle*); 2145 2146 /** 2147 * @brief Gets text decoration style. 2148 * 2149 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2150 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2151 * @return Returns text decoration style. 2152 * @since 12 2153 * @version 1.0 2154 */ 2155 OH_Drawing_TextDecorationStyle OH_Drawing_TextStyleGetDecorationStyle(OH_Drawing_TextStyle*); 2156 2157 /** 2158 * @brief Gets font weight. 2159 * 2160 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2161 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2162 * @return Returns font Weight. 2163 * @since 12 2164 * @version 1.0 2165 */ 2166 OH_Drawing_FontWeight OH_Drawing_TextStyleGetFontWeight(OH_Drawing_TextStyle*); 2167 2168 /** 2169 * @brief Gets font style. 2170 * 2171 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2172 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2173 * @return Returns font style. 2174 * @since 12 2175 * @version 1.0 2176 */ 2177 OH_Drawing_FontStyle OH_Drawing_TextStyleGetFontStyle(OH_Drawing_TextStyle*); 2178 2179 /** 2180 * @brief Gets the font baseline. 2181 * 2182 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2183 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2184 * @return Returns the font baseline. 2185 * @since 12 2186 * @version 1.0 2187 */ 2188 OH_Drawing_TextBaseline OH_Drawing_TextStyleGetBaseline(OH_Drawing_TextStyle*); 2189 2190 /** 2191 * @brief Gets a list of font families. 2192 * 2193 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2194 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2195 * @param num Indicates count of font families result. 2196 * @return Returns a list of font families. 2197 * @since 12 2198 * @version 1.0 2199 */ 2200 char** OH_Drawing_TextStyleGetFontFamilies(OH_Drawing_TextStyle*, size_t* num); 2201 2202 /** 2203 * @brief Releases the memory occupied by a list of font families. 2204 * 2205 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2206 * @param fontFamilies Indicates the pointer to a list of font families. 2207 * @param num Indicates the count of obtained font families. 2208 * @since 12 2209 * @version 1.0 2210 */ 2211 void OH_Drawing_TextStyleDestroyFontFamilies(char** fontFamilies, size_t num); 2212 2213 /** 2214 * @brief Gets font size. 2215 * 2216 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2217 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2218 * @return Returns font size. 2219 * @since 12 2220 * @version 1.0 2221 */ 2222 double OH_Drawing_TextStyleGetFontSize(OH_Drawing_TextStyle*); 2223 2224 /** 2225 * @brief Gets the letter spacing of the text. 2226 * 2227 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2228 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2229 * @return Returns the size of the letter spacing. 2230 * @since 12 2231 * @version 1.0 2232 */ 2233 double OH_Drawing_TextStyleGetLetterSpacing(OH_Drawing_TextStyle*); 2234 2235 /** 2236 * @brief Gets the word spacing of the text. 2237 * 2238 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2239 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2240 * @return Returns word spacing size. 2241 * @since 12 2242 * @version 1.0 2243 */ 2244 double OH_Drawing_TextStyleGetWordSpacing(OH_Drawing_TextStyle*); 2245 2246 /** 2247 * @brief Gets font height. 2248 * 2249 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2250 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2251 * @return Returns font height. 2252 * @since 12 2253 * @version 1.0 2254 */ 2255 double OH_Drawing_TextStyleGetFontHeight(OH_Drawing_TextStyle*); 2256 2257 /** 2258 * @brief Gets whether to set the text to half line spacing. 2259 * 2260 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2261 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2262 * @return Returns true indicates that the spacing takes effect, 2263 * false indicates that the spacing does not take effect. 2264 * @since 12 2265 * @version 1.0 2266 */ 2267 bool OH_Drawing_TextStyleGetHalfLeading(OH_Drawing_TextStyle*); 2268 2269 /** 2270 * @brief Gets the locale. 2271 * 2272 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2273 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2274 * @return Returns a locale of data type as a pointer to a char. As with the TextStyle lifecycle. 2275 * No release is required and the return value is invalidated after the set method is called. 2276 * @since 12 2277 * @version 1.0 2278 */ 2279 const char* OH_Drawing_TextStyleGetLocale(OH_Drawing_TextStyle*); 2280 2281 /** 2282 * @brief Sets the text style, including font weight, font width and font slant. 2283 * 2284 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2285 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2286 * @param OH_Drawing_FontStyleStruct Indicates an <b>OH_Drawing_FontStyleStruct</b> object. 2287 * @since 12 2288 * @version 1.0 2289 */ 2290 void OH_Drawing_SetTextStyleFontStyleStruct(OH_Drawing_TextStyle* drawingTextStyle, 2291 OH_Drawing_FontStyleStruct fontStyle); 2292 2293 /** 2294 * @brief Gets the text style, including font weight, font width and font slant. 2295 * 2296 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2297 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2298 * @return Returns the <b>OH_Drawing_FontStyleStruct</b> object getted. 2299 * @since 12 2300 * @version 1.0 2301 */ 2302 OH_Drawing_FontStyleStruct OH_Drawing_TextStyleGetFontStyleStruct(OH_Drawing_TextStyle* drawingTextStyle); 2303 2304 /** 2305 * @brief Sets the typography style, including font weight, font width and font slant. 2306 * 2307 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2308 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2309 * @param OH_Drawing_FontStyleStruct Indicates an <b>OH_Drawing_FontStyleStruct</b> object. 2310 * @since 12 2311 * @version 1.0 2312 */ 2313 void OH_Drawing_SetTypographyStyleFontStyleStruct(OH_Drawing_TypographyStyle* drawingStyle, 2314 OH_Drawing_FontStyleStruct fontStyle); 2315 2316 /** 2317 * @brief Gets the typography style, including font weight, font width and font slant. 2318 * 2319 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2320 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2321 * @return Returns the <b>OH_Drawing_FontStyleStruct</b> object getted. 2322 * @since 12 2323 * @version 1.0 2324 */ 2325 OH_Drawing_FontStyleStruct OH_Drawing_TypographyStyleGetFontStyleStruct(OH_Drawing_TypographyStyle* drawingStyle); 2326 2327 /** 2328 * @brief Gets whether the two TextStyle objects are equal. 2329 * 2330 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2331 * @param style Indicates source of comparison <b>OH_Drawing_TextStyle</b> object. 2332 * @param comparedStyle Indicates comparison <b>OH_Drawing_TextStyle</b> object. 2333 * @return Compare result. 2334 * @since 12 2335 * @version 1.0 2336 */ 2337 bool OH_Drawing_TextStyleIsEqual(const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle); 2338 2339 /** 2340 * @brief Gets whether the font properties of two TextStyle objects are equal. 2341 * 2342 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2343 * @param style Indicates source of <b>comparison OH_Drawing_TextStyle</b> object. 2344 * @param comparedStyle Indicates comparison <b>OH_Drawing_TextStyle</b> object. 2345 * @return Compare result. 2346 * @since 12 2347 * @version 1.0 2348 */ 2349 bool OH_Drawing_TextStyleIsEqualByFont(const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle); 2350 2351 /** 2352 * @brief Gets whether two TextStyle objects match attributes 2353 * 2354 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2355 * @param textStyleType Indicates enumerates of text style type. 2356 * @param style Indicates source of comparison <b>OH_Drawing_TextStyle</b> object. 2357 * @param comparedStyle Indicates comparison <b>OH_Drawing_TextStyle</b> object. 2358 * @return Match attributes result. 2359 * @since 12 2360 * @version 1.0 2361 */ 2362 bool OH_Drawing_TextStyleIsAttributeMatched(const OH_Drawing_TextStyle* style, 2363 const OH_Drawing_TextStyle* comparedStyle, OH_Drawing_TextStyleType textStyleType); 2364 2365 /** 2366 * @brief Set placeholder of TextStyle. 2367 * 2368 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2369 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2370 * @since 12 2371 * @version 1.0 2372 */ 2373 void OH_Drawing_TextStyleSetPlaceholder(OH_Drawing_TextStyle* style); 2374 2375 /** 2376 * @brief Gets whether placeholder is enable. 2377 * 2378 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2379 * @param OH_Drawing_TextStyle Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object. 2380 * @return Whether placeholder is enable. 2381 * @since 12 2382 * @version 1.0 2383 */ 2384 bool OH_Drawing_TextStyleIsPlaceholder(OH_Drawing_TextStyle* style); 2385 2386 /** 2387 * @brief Gets text alignment mode. 2388 * 2389 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2390 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2391 * @return Returns text alignment mode. 2392 * @since 12 2393 * @version 1.0 2394 */ 2395 OH_Drawing_TextAlign OH_Drawing_TypographyStyleGetEffectiveAlignment(OH_Drawing_TypographyStyle* style); 2396 2397 /** 2398 * @brief Gets whether the hinting is enabled. 2399 * 2400 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2401 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2402 * @return True, if the hinting takes effect; False, if the hinting does not take effect. 2403 * @since 12 2404 * @version 1.0 2405 */ 2406 bool OH_Drawing_TypographyStyleIsHintEnabled(OH_Drawing_TypographyStyle* style); 2407 2408 /** 2409 * @brief Gets system font configuration information. 2410 * 2411 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2412 * @param OH_Drawing_FontConfigInfoErrorCode Indicates error code returned, based on the error code to 2413 * release the memory of system font configuration information. 2414 * For details, see the enum <b>OH_Drawing_FontConfigInfoErrorCode</b>. 2415 * @return Returns a pointer to system font configuration information. 2416 * Indicates the pointer to an <b>OH_Drawing_FontConfigInfo</b> object. 2417 * @since 12 2418 * @version 1.0 2419 */ 2420 OH_Drawing_FontConfigInfo* OH_Drawing_GetSystemFontConfigInfo(OH_Drawing_FontConfigInfoErrorCode*); 2421 2422 /** 2423 * @brief Releases the memory occupied by system font configuration information. 2424 * 2425 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2426 * @param OH_Drawing_FontConfigInfo Indicates the pointer to an <b>OH_Drawing_FontConfigInfo</b> object. 2427 * @since 12 2428 * @version 1.0 2429 */ 2430 void OH_Drawing_DestroySystemFontConfigInfo(OH_Drawing_FontConfigInfo*); 2431 2432 /** 2433 * @brief Sets the strut style for text typography. 2434 * 2435 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2436 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2437 * @param OH_Drawing_StrutStyle Indicates the pointer of <b>OH_Drawing_StrutStyle</b> object. 2438 * @since 12 2439 * @version 1.0 2440 */ 2441 void OH_Drawing_SetTypographyStyleTextStrutStyle(OH_Drawing_TypographyStyle*, OH_Drawing_StrutStyle*); 2442 2443 /** 2444 * @brief Releases the memory occupied by an <b>OH_Drawing_StrutStyle</b> object. 2445 * 2446 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2447 * @param OH_Drawing_StrutStyle Indicates the pointer of <b>OH_Drawing_StrutStyle</b> object. 2448 * @since 12 2449 * @version 1.0 2450 */ 2451 void OH_Drawing_TypographyStyleDestroyStrutStyle(OH_Drawing_StrutStyle*); 2452 2453 /** 2454 * @brief Gets the strut style for text typography. 2455 * 2456 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2457 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2458 * @return Returns the pointer of <b>OH_Drawing_StrutStyle</b> object. 2459 * @since 12 2460 * @version 1.0 2461 */ 2462 OH_Drawing_StrutStyle* OH_Drawing_TypographyStyleGetStrutStyle(OH_Drawing_TypographyStyle*); 2463 2464 /** 2465 * @brief Overriding the struct StrutStyle equals operator. 2466 * 2467 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2468 * @param from Indicates source of comparison object. 2469 * @param to Indicates comparison object. 2470 * @since 12 2471 * @version 1.0 2472 */ 2473 bool OH_Drawing_TypographyStyleStrutStyleEquals(OH_Drawing_StrutStyle* from, OH_Drawing_StrutStyle* to); 2474 2475 /** 2476 * @brief Sets the hinting of text typography. 2477 * 2478 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2479 * @param OH_Drawing_TypographyStyle Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object. 2480 * @param hintsEnabled Indicates the hinting of text typography.. 2481 * @since 12 2482 * @version 1.0 2483 */ 2484 void OH_Drawing_TypographyStyleSetHintsEnabled(OH_Drawing_TypographyStyle* style, bool hintsEnabled); 2485 2486 /* @brief Getting all font metrics from target row. 2487 * 2488 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2489 * @param OH_Drawing_Typography Indicates a pointer to a typesetting object. 2490 * @param lineNumber Indicates specifies the number of rows. 2491 * @param fontMetricsSize Indicates the return size of font metrics struct from current line. 2492 * @return Returns all character measures for the current row. 2493 * @since 12 2494 * @version 1.0 2495 */ 2496 OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics(OH_Drawing_Typography*, 2497 size_t lineNumber, size_t* fontMetricsSize); 2498 2499 /** 2500 * @brief Free up all the space taken up by the lineFontMetric. 2501 * 2502 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2503 * @param OH_Drawing_Font_Metrics Indicates the first address of the lineFontMetric gather to be destroyed. 2504 * @since 12 2505 * @version 1.0 2506 */ 2507 void OH_Drawing_TypographyDestroyLineFontMetrics(OH_Drawing_Font_Metrics*); 2508 2509 /** 2510 * @brief Mark the Typography as dirty, and initially state the Typography. 2511 * 2512 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2513 * @param OH_Drawing_Typography Indicates the pointer to the text <b>OH_Drawing_Typography</b> object. 2514 * @since 12 2515 * @version 1.0 2516 */ 2517 void OH_Drawing_TypographyMarkDirty(OH_Drawing_Typography*); 2518 2519 /** 2520 * @brief Get the unresolved Glyphs count of lines in a text. 2521 * 2522 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2523 * @param OH_Drawing_Typography Indicates the pointer to the text <b>OH_Drawing_Typography</b> object. 2524 * @return Returns unresolved Glyphs count. 2525 * @since 12 2526 * @version 1.0 2527 */ 2528 int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount(OH_Drawing_Typography*); 2529 2530 /** 2531 * @brief Update the font size of lines in a text. 2532 * 2533 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2534 * @param OH_Drawing_Typography Indicates the pointer to the text <b>OH_Drawing_Typography</b> object. 2535 * @param from Indicates the source of the original font size. 2536 * @param to Indicates the destination of the updated font size. 2537 * @param fontSize Indicates the size of the font. 2538 * @since 12 2539 * @version 1.0 2540 */ 2541 void OH_Drawing_TypographyUpdateFontSize(OH_Drawing_Typography*, size_t from, size_t to, float fontSize); 2542 2543 /** 2544 * @brief Get whether the text layout enables line styles. 2545 * 2546 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2547 * @param OH_Drawing_TypographyStyle Indicates the pointer to the text <b>OH_Drawing_TypographyStyle</b> object. 2548 * @return Whether or not to enable line styles in text layout only, true means enable, false means disable. 2549 * @since 12 2550 * @version 1.0 2551 */ 2552 bool OH_Drawing_TypographyTextGetLineStyle(OH_Drawing_TypographyStyle*); 2553 2554 /** 2555 * @brief Get the font weight of line style for text typography. 2556 * 2557 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2558 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2559 * <b>OH_Drawing_TypographyStyle</b>. 2560 * @return Return the font weight of line style for text typography. 2561 * For details, see the enum <b>OH_Drawing_FontWeight</b>. 2562 * @since 12 2563 * @version 1.0 2564 */ 2565 OH_Drawing_FontWeight OH_Drawing_TypographyTextlineStyleGetFontWeight(OH_Drawing_TypographyStyle*); 2566 2567 /** 2568 * @brief Get the font style of line style for text typography. 2569 * 2570 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2571 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2572 * <b>OH_Drawing_TypographyStyle</b>. 2573 * @return Return the font style of line style for text typography. 2574 * For details, see the enum <b>OH_Drawing_FontStyle</b>. 2575 * @since 12 2576 * @version 1.0 2577 */ 2578 OH_Drawing_FontStyle OH_Drawing_TypographyTextlineStyleGetFontStyle(OH_Drawing_TypographyStyle*); 2579 2580 /** 2581 * @brief Get the font families of line style for text typography. 2582 * 2583 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2584 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2585 * <b>OH_Drawing_TypographyStyle</b>. 2586 * @param num The number of obtained font names. 2587 * @return Return the font families of line style for text typography. 2588 * @since 12 2589 * @version 1.0 2590 */ 2591 char** OH_Drawing_TypographyTextlineStyleGetFontFamilies(OH_Drawing_TypographyStyle*, size_t* num); 2592 2593 /** 2594 * @brief Releases the memory occupied by a list of font families names. 2595 * 2596 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2597 * @param fontFamilies Indicates the pointer to a list of font families names. 2598 * @param fontFamiliesNum Indicates the number of obtained font names. 2599 * @since 12 2600 * @version 1.0 2601 */ 2602 void OH_Drawing_TypographyTextlineStyleDestroyFontFamilies(char** fontFamilies, size_t fontFamiliesNum); 2603 2604 /** 2605 * @brief Get the font size of font size for text typography. 2606 * 2607 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2608 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2609 * <b>OH_Drawing_TypographyStyle</b>. 2610 * @return Return the font size of font size for text typography. 2611 * @since 12 2612 * @version 1.0 2613 */ 2614 double OH_Drawing_TypographyTextlineStyleGetFontSize(OH_Drawing_TypographyStyle*); 2615 2616 /** 2617 * @brief Get the font height scale in text layout. 2618 * 2619 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2620 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2621 * <b>OH_Drawing_TypographyStyle</b>. 2622 * @return Retrun the font height scale in text layout. 2623 * @since 12 2624 * @version 1.0 2625 */ 2626 double OH_Drawing_TypographyTextlineStyleGetHeightScale(OH_Drawing_TypographyStyle*); 2627 2628 /** 2629 * @brief Get whether to enable font height for line styles in text layout only. 2630 * 2631 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2632 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2633 * <b>OH_Drawing_TypographyStyle</b>. 2634 * @return Whether or not to enable the font height for line styles in text layout only, 2635 * true means enable, false means disable. 2636 * @since 12 2637 * @version 1.0 2638 */ 2639 bool OH_Drawing_TypographyTextlineStyleGetHeightOnly(OH_Drawing_TypographyStyle*); 2640 2641 /** 2642 * @brief Get the half leading of line style for text typography. 2643 * 2644 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2645 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2646 * <b>OH_Drawing_TypographyStyle</b>. 2647 * @return Whether to enable the text line half leading style, true means enable, false means disable. 2648 * @since 12 2649 * @version 1.0 2650 */ 2651 bool OH_Drawing_TypographyTextlineStyleGetHalfLeading(OH_Drawing_TypographyStyle*); 2652 2653 /** 2654 * @brief Get the spacing scale of line style for text typography. 2655 * 2656 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2657 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2658 * <b>OH_Drawing_TypographyStyle</b>. 2659 * @return Return the spacing scale of line style for text typography. 2660 * @since 12 2661 * @version 1.0 2662 */ 2663 double OH_Drawing_TypographyTextlineStyleGetSpacingScale(OH_Drawing_TypographyStyle*); 2664 2665 /** 2666 * @brief Get whether only line style is enabled for text typography. 2667 * 2668 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2669 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2670 * <b>OH_Drawing_TypographyStyle</b>. 2671 * @return Returns whether only line style is enabled for text layout, true means it is enabled, 2672 * false means it is not. 2673 * @since 12 2674 * @version 1.0 2675 */ 2676 bool OH_Drawing_TypographyTextlineGetStyleOnly(OH_Drawing_TypographyStyle*); 2677 2678 /** 2679 * @brief Get the text alignment mode. 2680 * 2681 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2682 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2683 * <b>OH_Drawing_TypographyStyle</b>. 2684 * @return Return the text alignment mode. For details, see the enum <b>OH_Drawing_TextAlign</b>. 2685 * @since 12 2686 * @version 1.0 2687 */ 2688 OH_Drawing_TextAlign OH_Drawing_TypographyGetTextAlign(OH_Drawing_TypographyStyle*); 2689 2690 /** 2691 * @brief Get the text direction. 2692 * 2693 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2694 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2695 * <b>OH_Drawing_TypographyStyle</b>. 2696 * @return Return the text direction. For details, see the enum <b>OH_Drawing_TextDirection</b>. 2697 * @since 12 2698 * @version 1.0 2699 */ 2700 OH_Drawing_TextDirection OH_Drawing_TypographyGetTextDirection(OH_Drawing_TypographyStyle*); 2701 2702 /** 2703 * @brief Sets the maximum number of lines in a text. 2704 * 2705 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2706 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2707 * <b>OH_Drawing_TypographyStyle</b>. 2708 * @return Return the maximum number of lines in a text. 2709 * @since 12 2710 * @version 1.0 2711 */ 2712 size_t OH_Drawing_TypographyGetTextMaxLines(OH_Drawing_TypographyStyle*); 2713 2714 /** 2715 * @brief Get the ellipsis of lines in a text. 2716 * 2717 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2718 * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object 2719 * <b>OH_Drawing_TypographyStyle</b>. 2720 * @return Return the ellipsis of lines in a text. 2721 * @since 12 2722 * @version 1.0 2723 */ 2724 char* OH_Drawing_TypographyGetTextEllipsis(OH_Drawing_TypographyStyle*); 2725 2726 /** 2727 * @brief Releases the memory occupied by a list of Ellipsis names. 2728 * 2729 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2730 * @param ellipsis Indicates the pointer to a list of Ellipsis names. 2731 * @since 12 2732 * @version 1.0 2733 */ 2734 void OH_Drawing_TypographyDestroyEllipsis(char* ellipsis); 2735 2736 /** 2737 * @brief Overriding the class ParagraphStyle equals operator. 2738 * 2739 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2740 * @param from Indicates source of comparison object. 2741 * @param to Indicates comparison object. 2742 * @return Compare result. 2743 * @since 12 2744 * @version 1.0 2745 */ 2746 bool OH_Drawing_TypographyStyleEquals(OH_Drawing_TypographyStyle* from, OH_Drawing_TypographyStyle* to); 2747 2748 /** 2749 * @brief Releases the memory occupied by text box. 2750 * 2751 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2752 * @param OH_Drawing_TextBox Indicates the pointer to a text box object <b>OH_Drawing_TextBox</b>. 2753 * @since 12 2754 * @version 1.0 2755 */ 2756 void OH_Drawing_TypographyDestroyTextBox(OH_Drawing_TextBox*); 2757 2758 /** 2759 * @brief Sets the parameter of text-shadow. 2760 * 2761 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 2762 * @param OH_Drawing_TextShadow Indicates the pointer to an <b>OH_Drawing_TextShadow</b> object. 2763 * @param color Indicates the color setting of text-shadow. 2764 * @param OH_Drawing_Point Indicates the pointer to an <b>OH_Drawing_Point</b> object. 2765 * @param blurRadius Indicates the radius of blur for text-shadow. 2766 * @since 12 2767 * @version 1.0 2768 */ 2769 void OH_Drawing_SetTextShadow(OH_Drawing_TextShadow* shadow, uint32_t color, OH_Drawing_Point* offset, 2770 double blurRadius); 2771 2772 #ifdef __cplusplus 2773 } 2774 #endif 2775 /** @} */ 2776 #endif