diff --git a/binding/SkiaSharp/SKTypeface.cs b/binding/SkiaSharp/SKTypeface.cs index 098628cb21..79499d9a31 100644 --- a/binding/SkiaSharp/SKTypeface.cs +++ b/binding/SkiaSharp/SKTypeface.cs @@ -142,6 +142,8 @@ public static SKTypeface FromData (SKData data, int index = 0) public int GlyphCount => SkiaApi.sk_typeface_count_glyphs (Handle); + public string PostScriptName => (string)SKString.GetObject (SkiaApi.sk_typeface_get_post_script_name (Handle)); + // GetTableTags public int TableCount => SkiaApi.sk_typeface_count_tables (Handle); diff --git a/binding/SkiaSharp/SkiaApi.generated.cs b/binding/SkiaSharp/SkiaApi.generated.cs index 54c68a436f..1773c6fe9e 100644 --- a/binding/SkiaSharp/SkiaApi.generated.cs +++ b/binding/SkiaSharp/SkiaApi.generated.cs @@ -16471,6 +16471,25 @@ internal static sk_string_t sk_typeface_get_family_name (sk_typeface_t typeface) (sk_typeface_get_family_name_delegate ??= GetSymbol ("sk_typeface_get_family_name")).Invoke (typeface); #endif + // sk_string_t* sk_typeface_get_post_script_name(const sk_typeface_t* typeface) + #if !USE_DELEGATES + #if USE_LIBRARY_IMPORT + [LibraryImport (SKIA)] + internal static partial sk_string_t sk_typeface_get_post_script_name (sk_typeface_t typeface); + #else // !USE_LIBRARY_IMPORT + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] + internal static extern sk_string_t sk_typeface_get_post_script_name (sk_typeface_t typeface); + #endif + #else + private partial class Delegates { + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] + internal delegate sk_string_t sk_typeface_get_post_script_name (sk_typeface_t typeface); + } + private static Delegates.sk_typeface_get_post_script_name sk_typeface_get_post_script_name_delegate; + internal static sk_string_t sk_typeface_get_post_script_name (sk_typeface_t typeface) => + (sk_typeface_get_post_script_name_delegate ??= GetSymbol ("sk_typeface_get_post_script_name")).Invoke (typeface); + #endif + // sk_font_style_slant_t sk_typeface_get_font_slant(const sk_typeface_t* typeface) #if !USE_DELEGATES #if USE_LIBRARY_IMPORT diff --git a/externals/skia b/externals/skia deleted file mode 160000 index 30abf4a0dc..0000000000 --- a/externals/skia +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 30abf4a0dcd3006f3a555e46906151e486f87b6e diff --git a/externals/skia b/externals/skia new file mode 120000 index 0000000000..fc7af82f06 --- /dev/null +++ b/externals/skia @@ -0,0 +1 @@ +/Users/jlipsky/Development/GitHub/skia \ No newline at end of file diff --git a/tests/Tests/SkiaSharp/SKTypefaceTest.cs b/tests/Tests/SkiaSharp/SKTypefaceTest.cs index 18978e0a10..d19da35991 100644 --- a/tests/Tests/SkiaSharp/SKTypefaceTest.cs +++ b/tests/Tests/SkiaSharp/SKTypefaceTest.cs @@ -55,6 +55,15 @@ public void TestIsFixedPitch() } } + [SkippableFact] + public void TestPostScriptName() + { + using (var typeface = SKTypeface.FromFile(Path.Combine(PathToFonts, "CourierNew.ttf"))) + { + Assert.Equal("CourierNewPSMT", typeface.PostScriptName); + } + } + [SkippableFact] public void CanReadNonASCIIFile() {