diff options
| author | 2024-06-24 14:22:50 +0000 | |
|---|---|---|
| committer | 2024-06-24 14:22:50 +0000 | |
| commit | 8faf3d40232f7cef05bf588a2f5b175f687232c7 (patch) | |
| tree | 13ccb7050b1475a8d802f267ed8faaf5da89e7ba /include | |
| parent | b72c3fec2ebe3226a1973dda88873830d53f0d0a (diff) | |
| parent | c8721a7dec45b3d209b3a3a2b7b9451cb4eecd6d (diff) | |
Merge "Fix ASystemFont docs." into main am: ef291395cd am: c8721a7dec
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3142698
Change-Id: I74851b165f0e5d3de24a221ba2ba6878ea7f6d2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/android/system_fonts.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/android/system_fonts.h b/include/android/system_fonts.h index 94484eaf54..2d3a2148ae 100644 --- a/include/android/system_fonts.h +++ b/include/android/system_fonts.h @@ -31,27 +31,27 @@ * * \code{.cpp} * ASystemFontIterator* iterator = ASystemFontIterator_open(); - * ASystemFont* font = NULL; + * AFont* font = NULL; * * while ((font = ASystemFontIterator_next(iterator)) != nullptr) { * // Look if the font is your desired one. - * if (ASystemFont_getWeight(font) == 400 && !ASystemFont_isItalic(font) - * && ASystemFont_getLocale(font) == NULL) { + * if (AFont_getWeight(font) == 400 && !AFont_isItalic(font) + * && AFont_getLocale(font) == NULL) { * break; * } - * ASystemFont_close(font); + * AFont_close(font); * } * ASystemFontIterator_close(iterator); * - * int fd = open(ASystemFont_getFontFilePath(font), O_RDONLY); - * int collectionIndex = ASystemFont_getCollectionINdex(font); + * int fd = open(AFont_getFontFilePath(font), O_RDONLY | O_CLOEXEC); + * int collectionIndex = AFont_getCollectionIndex(font); * std::vector<std::pair<uint32_t, float>> variationSettings; - * for (size_t i = 0; i < ASystemFont_getAxisCount(font); ++i) { + * for (size_t i = 0; i < AFont_getAxisCount(font); ++i) { * variationSettings.push_back(std::make_pair( - * ASystemFont_getAxisTag(font, i), - * ASystemFont_getAxisValue(font, i))); + * AFont_getAxisTag(font, i), + * AFont_getAxisValue(font, i))); * } - * ASystemFont_close(font); + * AFont_close(font); * * // Use this font for your text rendering engine. * @@ -99,7 +99,7 @@ typedef struct ASystemFontIterator ASystemFontIterator; /** * Create a system font iterator. * - * Use ASystemFont_close() to close the iterator. + * Use ASystemFontIterator_close() to close the iterator. * * Available since API level 29. * @@ -123,7 +123,7 @@ void ASystemFontIterator_close(ASystemFontIterator* _Nullable iterator) __INTROD * * \param iterator an iterator for the system fonts. Passing NULL is not allowed. * \return a font. If no more font is available, returns nullptr. You need to release the returned - * font by ASystemFont_close when it is no longer needed. + * font with AFont_close() when it is no longer needed. */ AFont* _Nullable ASystemFontIterator_next(ASystemFontIterator* _Nonnull iterator) __INTRODUCED_IN(29); |