From: Matthew Leibowitz Date: Fri, 21 Apr 2017 05:18:21 +0000 (+0200) Subject: Added some members X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e989b31f4a42ffac94e2b8acbea5a935d6d65cbd;p=platform%2Fupstream%2FlibSkiaSharp.git Added some members --- diff --git a/include/c/sk_stream.h b/include/c/sk_stream.h index a3c19eb..d76cd4c 100644 --- a/include/c/sk_stream.h +++ b/include/c/sk_stream.h @@ -50,6 +50,7 @@ SK_C_API bool sk_stream_seek(sk_stream_t* cstream, size_t position); SK_C_API bool sk_stream_move(sk_stream_t* cstream, long offset); SK_C_API bool sk_stream_has_length(sk_stream_t* cstream); SK_C_API size_t sk_stream_get_length(sk_stream_t* cstream); +SK_C_API const void* sk_stream_get_memory_base(sk_stream_t* cstream); //////////////////////////////////////////////////////////////////////////////// diff --git a/include/c/sk_typeface.h b/include/c/sk_typeface.h index e979ed1..086b790 100644 --- a/include/c/sk_typeface.h +++ b/include/c/sk_typeface.h @@ -22,6 +22,8 @@ SK_C_API sk_typeface_t* sk_typeface_create_from_typeface(sk_typeface_t* typeface SK_C_API sk_typeface_t* sk_typeface_create_from_file(const char* path, int index); SK_C_API sk_typeface_t* sk_typeface_create_from_stream(sk_stream_asset_t* stream, int index); SK_C_API int sk_typeface_chars_to_glyphs(sk_typeface_t* typeface, const char *chars, sk_encoding_t encoding, uint16_t glyphs[], int glyphCount); +SK_C_API sk_stream_asset_t* sk_typeface_open_stream(sk_typeface_t* typeface, int* ttcIndex); +SK_C_API int sk_typeface_get_units_per_em(sk_typeface_t* typeface); SK_C_API sk_string_t* sk_typeface_get_family_name(sk_typeface_t* typeface); SK_C_API int sk_typeface_get_font_weight(sk_typeface_t* typeface); diff --git a/src/c/sk_stream.cpp b/src/c/sk_stream.cpp index b554202..c2a7d8d 100644 --- a/src/c/sk_stream.cpp +++ b/src/c/sk_stream.cpp @@ -130,6 +130,11 @@ size_t sk_stream_get_length (sk_stream_t* cstream) return AsStream(cstream)->getLength(); } +const void* sk_stream_get_memory_base(sk_stream_t* cstream) +{ + return AsStream(cstream)->getMemoryBase(); +} + void sk_filewstream_destroy(sk_wstream_filestream_t* cstream) { delete AsFileWStream(cstream); diff --git a/src/c/sk_typeface.cpp b/src/c/sk_typeface.cpp index 680dadb..c92729e 100644 --- a/src/c/sk_typeface.cpp +++ b/src/c/sk_typeface.cpp @@ -48,6 +48,16 @@ int sk_typeface_chars_to_glyphs (sk_typeface_t* typeface, const char *chars, sk_ return (AsTypeface(typeface))->charsToGlyphs(chars, (SkTypeface::Encoding)encoding, glyphs, glyphCount); } +sk_stream_asset_t* sk_typeface_open_stream(sk_typeface_t* typeface, int* ttcIndex) +{ + return ToStreamAsset(AsTypeface(typeface)->openStream(ttcIndex)); +} + +int sk_typeface_get_units_per_em(sk_typeface_t* typeface) +{ + return AsTypeface(typeface)->getUnitsPerEm(); +} + int sk_typeface_glyph_count (sk_typeface_t* typeface) { return AsTypeface(typeface)->countGlyphs();