From 2b97043379db482cb2defc10b52f098c7ac85ed6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 1 Aug 2025 04:08:30 +0000 Subject: [PATCH] Cleanup: use doxygen comments for BLF headers --- source/blender/blenfont/BLF_api.hh | 16 ++++++++++------ source/blender/blenfont/BLF_enums.hh | 14 +++++++++----- .../blenfont/intern/blf_internal_types.hh | 19 ++++++++++++------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/source/blender/blenfont/BLF_api.hh b/source/blender/blenfont/BLF_api.hh index 180bbe600ce..6ba18f50d70 100644 --- a/source/blender/blenfont/BLF_api.hh +++ b/source/blender/blenfont/BLF_api.hh @@ -18,13 +18,13 @@ #include "BLI_sys_types.h" #include "BLI_vector.hh" -/* Name of sub-directory inside #BLENDER_DATAFILES that contains font files. */ +/** Name of sub-directory inside #BLENDER_DATAFILES that contains font files. */ #define BLF_DATAFILES_FONTS_DIR "fonts" -/* File name of the default variable-width font. */ +/** File name of the default variable-width font. */ #define BLF_DEFAULT_PROPORTIONAL_FONT "Inter.woff2" -/* File name of the default fixed-pitch font. */ +/** File name of the default fixed-pitch font. */ #define BLF_DEFAULT_MONOSPACED_FONT "DejaVuSansMono.woff2" struct ListBase; @@ -142,10 +142,14 @@ void BLF_size(int fontid, float size); */ void BLF_character_weight(int fontid, int weight); -/* Return the font's default design weight (100-900). */ +/** + * \return the font's default design weight (100-900). + */ int BLF_default_weight(int fontid) ATTR_WARN_UNUSED_RESULT; -/* Return true if the font has a variable (multiple master) weight axis. */ +/** + * \return true if the font has a variable (multiple master) weight axis. + */ bool BLF_has_variable_weight(int fontid) ATTR_WARN_UNUSED_RESULT; /* Goal: small but useful color API. */ @@ -253,7 +257,7 @@ size_t BLF_width_to_strlen(int fontid, float width, float *r_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2); /** - * Same as BLF_width_to_strlen but search from the string end. + * Same as #BLF_width_to_strlen but search from the string end. */ size_t BLF_width_to_rstrlen(int fontid, const char *str, diff --git a/source/blender/blenfont/BLF_enums.hh b/source/blender/blenfont/BLF_enums.hh index 80b0bc499f1..34416770cb4 100644 --- a/source/blender/blenfont/BLF_enums.hh +++ b/source/blender/blenfont/BLF_enums.hh @@ -18,10 +18,14 @@ enum class FontShadowType { }; enum class BLFWrapMode : int { - Minimal = 0, /* Only on ASCII space and line feed. Legacy and invariant. */ - Typographical = 1 << 0, /* Multilingual, informed by Unicode Standard Annex #14. */ - Path = 1 << 1, /* Wrap on file path separators, space, underscores. */ - HardLimit = 1 << 2, /* Line break at limit. */ + /** Only on ASCII space and line feed. Legacy and invariant. */ + Minimal = 0, + /** Multilingual, informed by Unicode Standard Annex #14. */ + Typographical = 1 << 0, + /** Wrap on file path separators, space, underscores. */ + Path = 1 << 1, + /** Line break at limit. */ + HardLimit = 1 << 2, }; enum FontFlags { @@ -57,7 +61,7 @@ enum FontFlags { */ BLF_RENDER_SUBPIXELAA = 1 << 18, - /* Do not look in other fonts when a glyph is not found in this font. */ + /** Do not look in other fonts when a glyph is not found in this font. */ BLF_NO_FALLBACK = 1 << 19, }; ENUM_OPERATORS(FontFlags, BLF_NO_FALLBACK); diff --git a/source/blender/blenfont/intern/blf_internal_types.hh b/source/blender/blenfont/intern/blf_internal_types.hh index 105b4b6dee2..e607bf8a106 100644 --- a/source/blender/blenfont/intern/blf_internal_types.hh +++ b/source/blender/blenfont/intern/blf_internal_types.hh @@ -117,7 +117,7 @@ struct BatchBLF { unsigned int glyph_len; /** Copy of `font->pos`. */ int ofs[2]; - /* Previous call `modelmatrix`. */ + /** Previous call `modelmatrix`. */ float mat[4][4]; bool enabled, active, simple_shader; GlyphCacheBLF *glyph_cache; @@ -361,11 +361,16 @@ struct FontBLF { /** Axes data for Adobe MM, TrueType GX, or OpenType variation fonts. */ FT_MM_Var *variations; - /** Character variations. */ - int char_weight; /* 100 - 900, 400 = normal. */ - float char_slant; /* Slant in clockwise degrees. 0.0 = upright. */ - float char_width; /* Factor of normal character width. 1.0 = normal. */ - float char_spacing; /* Factor of normal character spacing. 0.0 = normal. */ + /* Character variations. */ + + /** Wight in range: 100 - 900, 400 = normal. */ + int char_weight; + /** Slant in clockwise degrees. 0.0 = upright. */ + float char_slant; + /** Factor of normal character width. 1.0 = normal. */ + float char_width; + /** Factor of normal character spacing. 0.0 = normal. */ + float char_spacing; /** Max texture size. */ int tex_size_max; @@ -375,7 +380,7 @@ struct FontBLF { /** * List of glyph caches (#GlyphCacheBLF) for this font for size, DPI, bold, italic. - * Use blf_glyph_cache_acquire(font) and blf_glyph_cache_release(font) to access cache! + * Use `blf_glyph_cache_acquire(font)` and `blf_glyph_cache_release(font)` to access cache! */ blender::Vector> cache;