SK_C_API int sk_codec_output_scanline(sk_codec_t* codec, int inputScanline);
SK_C_API int sk_codec_get_frame_count(sk_codec_t* codec);
SK_C_API void sk_codec_get_frame_info(sk_codec_t* codec, sk_codec_frameinfo_t* frameInfo);
+SK_C_API bool sk_codec_get_frame_info_for_index(sk_codec_t* codec, int index, sk_codec_frameinfo_t* frameInfo);
SK_C_API int sk_codec_get_repetition_count(sk_codec_t* codec);
SK_C_PLUS_PLUS_END_GUARD
SK_C_API sk_pixmap_t* sk_pixmap_new_with_params(const sk_imageinfo_t* cinfo, const void* addr, size_t rowBytes);
SK_C_API void sk_pixmap_reset(sk_pixmap_t* cpixmap);
SK_C_API void sk_pixmap_reset_with_params(sk_pixmap_t* cpixmap, const sk_imageinfo_t* cinfo, const void* addr, size_t rowBytes);
-SK_C_API void sk_pixmap_get_info(sk_pixmap_t* cpixmap, sk_imageinfo_t* cinfo);
-SK_C_API size_t sk_pixmap_get_row_bytes(sk_pixmap_t* cpixmap);
-SK_C_API const void* sk_pixmap_get_pixels(sk_pixmap_t* cpixmap);
+SK_C_API void sk_pixmap_get_info(const sk_pixmap_t* cpixmap, sk_imageinfo_t* cinfo);
+SK_C_API size_t sk_pixmap_get_row_bytes(const sk_pixmap_t* cpixmap);
+SK_C_API const void* sk_pixmap_get_pixels(const sk_pixmap_t* cpixmap);
+SK_C_API const void* sk_pixmap_get_pixels_with_xy(const sk_pixmap_t* cpixmap, int x, int y);
+SK_C_API sk_color_t sk_pixmap_get_pixel_color(const sk_pixmap_t* cpixmap, int x, int y);
SK_C_API bool sk_pixmap_encode_image(sk_wstream_t* dst, const sk_pixmap_t* src, sk_encoded_image_format_t encoder, int quality);
-SK_C_API bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY);
+SK_C_API bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, sk_transfer_function_behavior_t behavior);
SK_C_API bool sk_pixmap_scale_pixels(const sk_pixmap_t* cpixmap, const sk_pixmap_t* dst, sk_filter_quality_t quality);
+SK_C_API bool sk_pixmap_extract_subset(const sk_pixmap_t* cpixmap, sk_pixmap_t* result, const sk_irect_t* subset);
+SK_C_API bool sk_pixmap_erase_color(const sk_pixmap_t* cpixmap, sk_color_t color, const sk_irect_t* subset);
SK_C_API sk_color_t sk_color_unpremultiply(const sk_pmcolor_t pmcolor);
SK_C_API sk_pmcolor_t sk_color_premultiply(const sk_color_t color);
SK_C_PLUS_PLUS_BEGIN_GUARD
-SK_C_API sk_typeface_t* sk_typeface_create_from_name_with_font_style(const char *familyName, int weight, int width, sk_font_style_slant_t slant);
+// typeface
+
+SK_C_API sk_typeface_t* sk_typeface_create_from_name_with_font_style(const char *familyName, sk_fontstyle_t* style);
SK_C_API void sk_typeface_unref(sk_typeface_t*);
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 sk_fontstyle_t* sk_typeface_get_fontstyle(sk_typeface_t* typeface);
SK_C_API int sk_typeface_get_font_weight(sk_typeface_t* typeface);
SK_C_API int sk_typeface_get_font_width(sk_typeface_t* typeface);
SK_C_API sk_font_style_slant_t sk_typeface_get_font_slant(sk_typeface_t* typeface);
-
SK_C_API int sk_typeface_count_tables(sk_typeface_t* typeface);
SK_C_API int sk_typeface_get_table_tags(sk_typeface_t* typeface, sk_font_table_tag_t tags[]);
SK_C_API size_t sk_typeface_get_table_size(sk_typeface_t* typeface, sk_font_table_tag_t tag);
SK_C_API size_t sk_typeface_get_table_data(sk_typeface_t* typeface, sk_font_table_tag_t tag, size_t offset, size_t length, void* data);
+// font manager
+
SK_C_API sk_fontmgr_t* sk_fontmgr_create_default(void);
SK_C_API sk_fontmgr_t* sk_fontmgr_ref_default(void);
SK_C_API void sk_fontmgr_unref(sk_fontmgr_t*);
SK_C_API int sk_fontmgr_count_families(sk_fontmgr_t*);
SK_C_API void sk_fontmgr_get_family_name(sk_fontmgr_t*, int index, sk_string_t* familyName);
-SK_C_API sk_typeface_t* sk_fontmgr_match_family_style_character(sk_fontmgr_t*, const char* familyName, int weight, int width, sk_font_style_slant_t slant, const char** bcp47, int bcp47Count, int32_t character);
+SK_C_API sk_fontstyleset_t* sk_fontmgr_create_styleset(sk_fontmgr_t*, int index);
+SK_C_API sk_fontstyleset_t* sk_fontmgr_match_family(sk_fontmgr_t*, const char* familyName);
+SK_C_API sk_typeface_t* sk_fontmgr_match_family_style(sk_fontmgr_t*, const char* familyName, sk_fontstyle_t* style);
+SK_C_API sk_typeface_t* sk_fontmgr_match_family_style_character(sk_fontmgr_t*, const char* familyName, sk_fontstyle_t* style, const char** bcp47, int bcp47Count, int32_t character);
+SK_C_API sk_typeface_t* sk_fontmgr_match_face_style(sk_fontmgr_t*, const sk_typeface_t* face, sk_fontstyle_t* style);
+SK_C_API sk_typeface_t* sk_fontmgr_create_from_data(sk_fontmgr_t*, sk_data_t* data, int index);
+SK_C_API sk_typeface_t* sk_fontmgr_create_from_stream(sk_fontmgr_t*, sk_stream_asset_t* stream, int index);
+SK_C_API sk_typeface_t* sk_fontmgr_create_from_file(sk_fontmgr_t*, const char* path, int index);
+
+// font style
+
+SK_C_API sk_fontstyle_t* sk_fontstyle_new(int weight, int width, sk_font_style_slant_t slant);
+SK_C_API void sk_fontstyle_delete(sk_fontstyle_t* fs);
+SK_C_API int sk_fontstyle_get_weight(const sk_fontstyle_t* fs);
+SK_C_API int sk_fontstyle_get_width(const sk_fontstyle_t* fs);
+SK_C_API sk_font_style_slant_t sk_fontstyle_get_slant(const sk_fontstyle_t* fs);
+
+// font style set
+
+SK_C_API sk_fontstyleset_t* sk_fontstyleset_create_empty();
+SK_C_API void sk_fontstyleset_unref(sk_fontstyleset_t* fss);
+SK_C_API int sk_fontstyleset_get_count(sk_fontstyleset_t* fss);
+SK_C_API void sk_fontstyleset_get_style(sk_fontstyleset_t* fss, int index, sk_fontstyle_t* fs, sk_string_t* style);
+SK_C_API sk_typeface_t* sk_fontstyleset_create_typeface(sk_fontstyleset_t* fss, int index);
+SK_C_API sk_typeface_t* sk_fontstyleset_match_style(sk_fontstyleset_t* fss, sk_fontstyle_t* style);
SK_C_PLUS_PLUS_END_GUARD
typedef struct sk_typeface_t sk_typeface_t;
typedef uint32_t sk_font_table_tag_t;
typedef struct sk_fontmgr_t sk_fontmgr_t;
+typedef struct sk_fontstyle_t sk_fontstyle_t;
+typedef struct sk_fontstyleset_t sk_fontstyleset_t;
/**
* Abstraction layer directly on top of an image codec.
*/
SkImageInfo info;
from_c(*requestedInfo, &info);
- return bmp->tryAllocPixels(info, flags);
+ return bmp->tryAllocPixelsFlags(info, flags);
}
void sk_bitmap_set_pixels(sk_bitmap_t* cbitmap, void* pixels)
cframes[i] = frames[i];
}
+bool sk_codec_get_frame_info_for_index(sk_codec_t* codec, int index, sk_codec_frameinfo_t* frameInfo) {
+ return AsCodec(codec)->getFrameInfo(index, AsFrameInfo(frameInfo));
+}
+
int sk_codec_get_repetition_count(sk_codec_t* codec) {
return AsCodec(codec)->getRepetitionCount();
}
static_assert ((int)SkCodec::ZeroInitialized::kYes_ZeroInitialized == (int)YES_SK_CODEC_ZERO_INITIALIZED, ASSERT_MSG(SkCodec::ZeroInitialized, sk_codec_zero_initialized_t));
static_assert ((int)SkCodec::ZeroInitialized::kNo_ZeroInitialized == (int)NO_SK_CODEC_ZERO_INITIALIZED, ASSERT_MSG(SkCodec::ZeroInitialized, sk_codec_zero_initialized_t));
+// sk_transfer_function_behavior_t
+static_assert ((int)SkTransferFunctionBehavior::kRespect == (int)RESPECT_SK_TRANSFER_FUNCTION_BEHAVIOR, ASSERT_MSG(SkTransferFunctionBehavior, sk_transfer_function_behavior_t));
+static_assert ((int)SkTransferFunctionBehavior::kIgnore == (int)IGNORE_SK_TRANSFER_FUNCTION_BEHAVIOR, ASSERT_MSG(SkTransferFunctionBehavior, sk_transfer_function_behavior_t));
+
// sk_codec_scanline_order_t
static_assert ((int)SkCodec::SkScanlineOrder::kTopDown_SkScanlineOrder == (int)TOP_DOWN_SK_CODEC_SCANLINE_ORDER, ASSERT_MSG(SkCodec::SkScanlineOrder, sk_codec_scanline_order_t));
static_assert ((int)SkCodec::SkScanlineOrder::kBottomUp_SkScanlineOrder == (int)BOTTOM_UP_SK_CODEC_SCANLINE_ORDER, ASSERT_MSG(SkCodec::SkScanlineOrder, sk_codec_scanline_order_t));
AsPixmap(cpixmap)->reset(info, addr, rowBytes);
}
-void sk_pixmap_get_info(sk_pixmap_t* cpixmap, sk_imageinfo_t* cinfo)
+void sk_pixmap_get_info(const sk_pixmap_t* cpixmap, sk_imageinfo_t* cinfo)
{
from_sk(AsPixmap(cpixmap)->info(), cinfo);
}
-size_t sk_pixmap_get_row_bytes(sk_pixmap_t* cpixmap)
+size_t sk_pixmap_get_row_bytes(const sk_pixmap_t* cpixmap)
{
return AsPixmap(cpixmap)->rowBytes();
}
-const void* sk_pixmap_get_pixels(sk_pixmap_t* cpixmap)
+const void* sk_pixmap_get_pixels(const sk_pixmap_t* cpixmap)
{
return AsPixmap(cpixmap)->addr();
}
+const void* sk_pixmap_get_pixels_with_xy(const sk_pixmap_t* cpixmap, int x, int y)
+{
+ return AsPixmap(cpixmap)->addr(x, y);
+}
+
+sk_color_t sk_pixmap_get_pixel_color(const sk_pixmap_t* cpixmap, int x, int y)
+{
+ return AsPixmap(cpixmap)->getColor(x, y);
+}
+
+bool sk_pixmap_extract_subset(const sk_pixmap_t* cpixmap, sk_pixmap_t* result, const sk_irect_t* subset)
+{
+ return AsPixmap(cpixmap)->extractSubset(AsPixmap(result), *AsIRect(subset));
+}
+
+bool sk_pixmap_erase_color (const sk_pixmap_t* cpixmap, sk_color_t color, const sk_irect_t* subset)
+{
+ return AsPixmap(cpixmap)->erase((SkColor)color, *AsIRect(subset));
+}
+
sk_color_t sk_color_unpremultiply(const sk_pmcolor_t pmcolor)
{
return SkUnPreMultiply::PMColorToColor(pmcolor);
return SkEncodeImage(AsWStream(dst), AsPixmap(*src), (SkEncodedImageFormat)encoder, quality);
}
-bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY)
+bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, sk_transfer_function_behavior_t behavior)
{
SkImageInfo info;
from_c(*dstInfo, &info);
- return AsPixmap(cpixmap)->readPixels(info, dstPixels, dstRowBytes, srcX, srcY);
+ return AsPixmap(cpixmap)->readPixels(info, dstPixels, dstRowBytes, srcX, srcY, (SkTransferFunctionBehavior)behavior);
}
bool sk_pixmap_scale_pixels(const sk_pixmap_t* cpixmap, const sk_pixmap_t* dst, sk_filter_quality_t quality) {
#include "SkFontMgr.h"
#include "SkFontStyle.h"
+#include <memory>
+
#include "sk_typeface.h"
#include "sk_types_priv.h"
-void sk_typeface_unref(sk_typeface_t* tf)
-{
+// typeface
+
+void sk_typeface_unref(sk_typeface_t* tf) {
SkSafeUnref(AsTypeface(tf));
}
-sk_typeface_t* sk_typeface_create_from_name_with_font_style(const char *familyName, int weight, int width, sk_font_style_slant_t slant)
-{
- return ToTypeface(SkTypeface::MakeFromName (familyName, SkFontStyle(weight, width, (SkFontStyle::Slant)slant)).release());
+sk_typeface_t* sk_typeface_create_from_name_with_font_style(const char *familyName, sk_fontstyle_t* style) {
+ return ToTypeface(SkTypeface::MakeFromName (familyName, *AsFontStyle(style)).release());
}
-sk_typeface_t* sk_typeface_create_from_file(const char* path, int index)
-{
+sk_typeface_t* sk_typeface_create_from_file(const char* path, int index) {
return ToTypeface(SkTypeface::MakeFromFile (path, index).release());
}
-sk_typeface_t* sk_typeface_create_from_stream(sk_stream_asset_t* stream, int index)
-{
+sk_typeface_t* sk_typeface_create_from_stream(sk_stream_asset_t* stream, int index) {
return ToTypeface(SkTypeface::MakeFromStream (AsStreamAsset(stream), index).release());
}
-int sk_typeface_chars_to_glyphs (sk_typeface_t* typeface, const char *chars, sk_encoding_t encoding, uint16_t glyphs [], int glyphCount)
-{
+int sk_typeface_chars_to_glyphs (sk_typeface_t* typeface, const char *chars, sk_encoding_t encoding, uint16_t glyphs [], int glyphCount) {
return (AsTypeface(typeface))->charsToGlyphs(chars, (SkTypeface::Encoding)encoding, glyphs, glyphCount);
}
-sk_stream_asset_t* sk_typeface_open_stream(sk_typeface_t* typeface, int* ttcIndex)
-{
+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)
-{
+int sk_typeface_get_units_per_em(sk_typeface_t* typeface) {
return AsTypeface(typeface)->getUnitsPerEm();
}
-int sk_typeface_glyph_count (sk_typeface_t* typeface)
-{
+int sk_typeface_glyph_count (sk_typeface_t* typeface) {
return AsTypeface(typeface)->countGlyphs();
}
-sk_string_t* sk_typeface_get_family_name(sk_typeface_t* typeface)
-{
+sk_string_t* sk_typeface_get_family_name(sk_typeface_t* typeface) {
SkString* family_name = new SkString();
AsTypeface(typeface)->getFamilyName(family_name);
return ToString(family_name);
}
-int sk_typeface_get_font_weight(sk_typeface_t* typeface)
-{
+sk_fontstyle_t* sk_typeface_get_fontstyle(sk_typeface_t* typeface) {
+ SkFontStyle fs = AsTypeface(typeface)->fontStyle();
+ return ToFontStyle(new SkFontStyle(fs.weight(), fs.width(), fs.slant()));
+}
+
+int sk_typeface_get_font_weight(sk_typeface_t* typeface) {
return AsTypeface(typeface)->fontStyle().weight();
}
-int sk_typeface_get_font_width(sk_typeface_t* typeface)
-{
+int sk_typeface_get_font_width(sk_typeface_t* typeface) {
return AsTypeface(typeface)->fontStyle().width();
}
-sk_font_style_slant_t sk_typeface_get_font_slant(sk_typeface_t* typeface)
-{
+sk_font_style_slant_t sk_typeface_get_font_slant(sk_typeface_t* typeface) {
return (sk_font_style_slant_t)AsTypeface(typeface)->fontStyle().slant();
}
-int sk_typeface_count_tables(sk_typeface_t* typeface)
-{
+int sk_typeface_count_tables(sk_typeface_t* typeface) {
return AsTypeface(typeface)->countTables();
}
-int sk_typeface_get_table_tags(sk_typeface_t* typeface, sk_font_table_tag_t tags[])
-{
+int sk_typeface_get_table_tags(sk_typeface_t* typeface, sk_font_table_tag_t tags[]) {
return AsTypeface(typeface)->getTableTags(tags);
}
-size_t sk_typeface_get_table_size(sk_typeface_t* typeface, sk_font_table_tag_t tag)
-{
+size_t sk_typeface_get_table_size(sk_typeface_t* typeface, sk_font_table_tag_t tag) {
return AsTypeface(typeface)->getTableSize(tag);
}
-size_t sk_typeface_get_table_data(sk_typeface_t* typeface, sk_font_table_tag_t tag, size_t offset, size_t length, void* data)
-{
+size_t sk_typeface_get_table_data(sk_typeface_t* typeface, sk_font_table_tag_t tag, size_t offset, size_t length, void* data) {
return AsTypeface(typeface)->getTableData(tag, offset, length, data);
}
-sk_fontmgr_t* sk_fontmgr_create_default()
-{
+
+// font manager
+
+sk_fontmgr_t* sk_fontmgr_create_default(void) {
return ToFontMgr(SkFontMgr::MakeDefault().release());
}
-sk_fontmgr_t* sk_fontmgr_ref_default()
-{
+sk_fontmgr_t* sk_fontmgr_ref_default(void) {
return ToFontMgr(SkFontMgr::RefDefault().release());
}
-void sk_fontmgr_unref(sk_fontmgr_t* fontmgr)
-{
+void sk_fontmgr_unref(sk_fontmgr_t* fontmgr) {
AsFontMgr(fontmgr)->unref();
}
-int sk_fontmgr_count_families(sk_fontmgr_t* fontmgr)
-{
+int sk_fontmgr_count_families(sk_fontmgr_t* fontmgr) {
return AsFontMgr(fontmgr)->countFamilies();
}
-void sk_fontmgr_get_family_name(sk_fontmgr_t* fontmgr, int index, sk_string_t* familyName)
-{
+void sk_fontmgr_get_family_name(sk_fontmgr_t* fontmgr, int index, sk_string_t* familyName) {
AsFontMgr(fontmgr)->getFamilyName(index, AsString(familyName));
}
-sk_typeface_t* sk_fontmgr_match_family_style_character(sk_fontmgr_t* fontmgr, const char* familyName, int weight, int width, sk_font_style_slant_t slant, const char** bcp47, int bcp47Count, int32_t character)
-{
- SkFontStyle style = SkFontStyle(weight, width, (SkFontStyle::Slant)slant);
- SkTypeface* typeface = AsFontMgr(fontmgr)->matchFamilyStyleCharacter(familyName, style, bcp47, bcp47Count, character);
- return ToTypeface(typeface);
+sk_fontstyleset_t* sk_fontmgr_create_styleset(sk_fontmgr_t* fontmgr, int index) {
+ return ToFontStyleSet(AsFontMgr(fontmgr)->createStyleSet(index));
+}
+
+sk_fontstyleset_t* sk_fontmgr_match_family(sk_fontmgr_t* fontmgr, const char* familyName) {
+ return ToFontStyleSet(AsFontMgr(fontmgr)->matchFamily(familyName));
+}
+
+sk_typeface_t* sk_fontmgr_match_family_style(sk_fontmgr_t* fontmgr, const char* familyName, sk_fontstyle_t* style) {
+ return ToTypeface(AsFontMgr(fontmgr)->matchFamilyStyle(familyName, *AsFontStyle(style)));
+}
+
+sk_typeface_t* sk_fontmgr_match_family_style_character(sk_fontmgr_t* fontmgr, const char* familyName, sk_fontstyle_t* style, const char** bcp47, int bcp47Count, int32_t character) {
+ return ToTypeface(AsFontMgr(fontmgr)->matchFamilyStyleCharacter(familyName, *AsFontStyle(style), bcp47, bcp47Count, character));
}
+sk_typeface_t* sk_fontmgr_match_face_style(sk_fontmgr_t* fontmgr, const sk_typeface_t* face, sk_fontstyle_t* style) {
+ return ToTypeface(AsFontMgr(fontmgr)->matchFaceStyle(AsTypeface(face), *AsFontStyle(style)));
+}
+
+sk_typeface_t* sk_fontmgr_create_from_data(sk_fontmgr_t* fontmgr, sk_data_t* data, int index) {
+ return ToTypeface(AsFontMgr(fontmgr)->makeFromData(sk_ref_sp(AsData(data)), index).release());
+}
+
+sk_typeface_t* sk_fontmgr_create_from_stream(sk_fontmgr_t* fontmgr, sk_stream_asset_t* stream, int index) {
+ return ToTypeface(AsFontMgr(fontmgr)->makeFromStream(std::unique_ptr<SkStreamAsset>(AsStreamAsset(stream)), index).release());
+}
+
+sk_typeface_t* sk_fontmgr_create_from_file(sk_fontmgr_t* fontmgr, const char* path, int index) {
+ return ToTypeface(AsFontMgr(fontmgr)->makeFromFile(path, index).release());
+}
+
+
+// font style
+
+sk_fontstyle_t* sk_fontstyle_new(int weight, int width, sk_font_style_slant_t slant) {
+ return ToFontStyle(new SkFontStyle(weight, width, (SkFontStyle::Slant)slant));
+}
+
+void sk_fontstyle_delete(sk_fontstyle_t* fs) {
+ delete AsFontStyle(fs);
+}
+
+int sk_fontstyle_get_weight(const sk_fontstyle_t* fs) {
+ return AsFontStyle(fs)->weight();
+}
+
+int sk_fontstyle_get_width(const sk_fontstyle_t* fs) {
+ return AsFontStyle(fs)->width();
+}
+
+sk_font_style_slant_t sk_fontstyle_get_slant(const sk_fontstyle_t* fs) {
+ return (sk_font_style_slant_t)AsFontStyle(fs)->slant();
+}
+
+
+// font style set
+
+sk_fontstyleset_t* sk_fontstyleset_create_empty() {
+ return ToFontStyleSet(SkFontStyleSet::CreateEmpty());
+}
+
+void sk_fontstyleset_unref(sk_fontstyleset_t* fss) {
+ AsFontStyleSet(fss)->unref();
+}
+
+int sk_fontstyleset_get_count(sk_fontstyleset_t* fss) {
+ return AsFontStyleSet(fss)->count();
+}
+
+void sk_fontstyleset_get_style(sk_fontstyleset_t* fss, int index, sk_fontstyle_t* fs, sk_string_t* style) {
+ return AsFontStyleSet(fss)->getStyle(index, AsFontStyle(fs), AsString(style));
+}
+
+sk_typeface_t* sk_fontstyleset_create_typeface(sk_fontstyleset_t* fss, int index) {
+ return ToTypeface(AsFontStyleSet(fss)->createTypeface(index));
+}
+
+sk_typeface_t* sk_fontstyleset_match_style(sk_fontstyleset_t* fss, sk_fontstyle_t* style) {
+ return ToTypeface(AsFontStyleSet(fss)->matchStyle(*AsFontStyle(style)));
+}
DEF_CLASS_MAP(SkFILEStream, sk_stream_filestream_t, FileStream)
DEF_CLASS_MAP(SkFILEWStream, sk_wstream_filestream_t, FileWStream)
DEF_CLASS_MAP(SkFontMgr, sk_fontmgr_t, FontMgr)
+DEF_CLASS_MAP(SkFontStyle, sk_fontstyle_t, FontStyle)
+DEF_CLASS_MAP(SkFontStyleSet, sk_fontstyleset_t, FontStyleSet)
DEF_CLASS_MAP(SkImage, sk_image_t, Image)
DEF_CLASS_MAP(SkImageFilter, sk_imagefilter_t, ImageFilter)
DEF_CLASS_MAP(SkMaskFilter, sk_maskfilter_t, MaskFilter)