From ee4bd198dfe298511d0d07cec4109654ad68ce78 Mon Sep 17 00:00:00 2001 From: adrian gallero Date: Fri, 13 May 2016 13:31:51 -0300 Subject: [PATCH] changed sk_typeface_get_family_name to return an sk_string --- include/c/xamarin/sk_x_typeface.h | 2 +- src/c/xamarin/sk_x_typeface.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/c/xamarin/sk_x_typeface.h b/include/c/xamarin/sk_x_typeface.h index f280a96..8a7274f 100644 --- a/include/c/xamarin/sk_x_typeface.h +++ b/include/c/xamarin/sk_x_typeface.h @@ -23,7 +23,7 @@ SK_API sk_typeface_t* sk_typeface_create_from_file(const char* path, int index); SK_API sk_typeface_t* sk_typeface_create_from_stream(sk_stream_asset_t* stream, int index); SK_API int sk_typeface_chars_to_glyphs(sk_typeface_t* typeface, const char *chars, sk_encoding_t encoding, uint16_t glyphs[], int glyphCount); -SK_API void sk_typeface_get_family_name(sk_typeface_t* typeface, sk_string_t* family_name); +SK_API sk_string_t* sk_typeface_get_family_name(sk_typeface_t* typeface); SK_API int sk_typeface_count_tables(sk_typeface_t* typeface); SK_API int sk_typeface_get_table_tags(sk_typeface_t* typeface, sk_font_table_tag_t tags[]); diff --git a/src/c/xamarin/sk_x_typeface.cpp b/src/c/xamarin/sk_x_typeface.cpp index 14fcea3..2cf4686 100644 --- a/src/c/xamarin/sk_x_typeface.cpp +++ b/src/c/xamarin/sk_x_typeface.cpp @@ -75,9 +75,11 @@ int sk_typeface_glyph_count (sk_typeface_t* typeface) return ((SkTypeface*) typeface)->countGlyphs(); } -void sk_typeface_get_family_name(sk_typeface_t* typeface, sk_string_t* family_name) +sk_string_t* sk_typeface_get_family_name(sk_typeface_t* typeface) { - ((SkTypeface*)typeface)->getFamilyName(AsString(family_name)); + SkString* family_name = new SkString(); + ((SkTypeface*)typeface)->getFamilyName(family_name); + return ToString(family_name); } int sk_typeface_count_tables(sk_typeface_t* typeface) -- 2.7.4