Skip to content

Added support for getPostScriptName to SkTypeface #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: skiasharp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/c/sk_typeface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ SK_C_API int sk_typeface_get_units_per_em(const sk_typeface_t* typeface);
SK_C_API bool sk_typeface_get_kerning_pair_adjustments(const sk_typeface_t* typeface, const uint16_t glyphs[], int count, int32_t adjustments[]);
// TODO: createFamilyNameIterator
SK_C_API sk_string_t* sk_typeface_get_family_name(const sk_typeface_t* typeface);
SK_C_API sk_string_t* sk_typeface_get_post_script_name(const sk_typeface_t* typeface);
SK_C_API sk_stream_asset_t* sk_typeface_open_stream(const sk_typeface_t* typeface, int* ttcIndex);


Expand Down
6 changes: 6 additions & 0 deletions src/c/sk_typeface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ sk_string_t* sk_typeface_get_family_name(const sk_typeface_t* typeface) {
return ToString(family_name);
}

sk_string_t* sk_typeface_get_post_script_name(const sk_typeface_t* typeface) {
SkString* ps_name = new SkString();
AsTypeface(typeface)->getPostScriptName(ps_name);
return ToString(ps_name);
}

sk_stream_asset_t* sk_typeface_open_stream(const sk_typeface_t* typeface, int* ttcIndex) {
return ToStreamAsset(AsTypeface(typeface)->openStream(ttcIndex).release());
}
Expand Down