Added some members
authorMatthew Leibowitz <mattleibow@live.com>
Fri, 21 Apr 2017 05:18:21 +0000 (07:18 +0200)
committerMatthew Leibowitz <mattleibow@live.com>
Fri, 21 Apr 2017 05:18:21 +0000 (07:18 +0200)
include/c/sk_stream.h
include/c/sk_typeface.h
src/c/sk_stream.cpp
src/c/sk_typeface.cpp

index a3c19eb..d76cd4c 100644 (file)
@@ -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);
 
 ////////////////////////////////////////////////////////////////////////////////
 
index e979ed1..086b790 100644 (file)
@@ -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);
index b554202..c2a7d8d 100644 (file)
@@ -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);
index 680dadb..c92729e 100644 (file)
@@ -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();