[vlc-commits] freetype: add font name in coretext debug

Francois Cartegnie git at videolan.org
Tue Aug 11 13:30:36 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Aug  6 17:37:58 2020 +0200| [f8ea17a2a237e0b37567084ebffdf503302420a1] | committer: Francois Cartegnie

freetype: add font name in coretext debug

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f8ea17a2a237e0b37567084ebffdf503302420a1
---

 modules/text_renderer/freetype/fonts/darwin.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/text_renderer/freetype/fonts/darwin.c b/modules/text_renderer/freetype/fonts/darwin.c
index 238a369e56..9c81b78729 100644
--- a/modules/text_renderer/freetype/fonts/darwin.c
+++ b/modules/text_renderer/freetype/fonts/darwin.c
@@ -71,7 +71,12 @@ static void addNewFontToFamily(vlc_font_select_t *fs, CTFontDescriptorRef iter,
     b_italic = traitValue > 0.03;
 
 #ifndef NDEBUG
-    msg_Dbg(fs->p_obj, "New font: bold %i italic %i path '%s'", b_bold, b_italic, path);
+    CFStringRef name = CTFontDescriptorCopyAttribute(iter, kCTFontNameAttribute);
+    char *psz_name = name ? FromCFString(name, kCFStringEncodingUTF8) : 0;
+    msg_Dbg(fs->p_obj, "New font: (%s) bold %i italic %i path '%s'", psz_name, b_bold, b_italic, path);
+    free(psz_name);
+    if(name)
+        CFRelease(name);
 #else
     VLC_UNUSED(fs);
 #endif



More information about the vlc-commits mailing list