Skip to content

Conversation

@lindexi
Copy link
Contributor

@lindexi lindexi commented Jul 5, 2022

Description of Change

I change the string input argument from string to IntPtr. The sk_fontmgr_match_family_style should input the utf8 encoding string, but we will input the Unicode16 string to it. That is why we can not load the font which the font name contains the unicode text, such as the Chinese font.

Bugs Fixed

API Changes

None.

Behavioral Changes

Now, we can load the font which the font name contains unicode text, such as the Chinese font.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

@lindexi
Copy link
Contributor Author

lindexi commented Jul 6, 2022

Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR and catching those unicode issues!

The SkiaApi.generated.cs is generated by the tools, so these changes will get overwritten. You should rather edit the json file and then re-run the generator: https://github.com/mono/SkiaSharp/tree/main/utils#generate

Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Ready to go!

@mattleibow mattleibow merged commit 4e295f6 into mono:main Aug 8, 2022
mattleibow added a commit that referenced this pull request Aug 8, 2022
Co-authored-by: lindexi <lindexi_gd@163.com>
@mattleibow
Copy link
Contributor

I absolutely butchered the merge, so the commit is not so great. Sorry about that - had to create a special merge commit on that: 6f8fc4d

@lindexi
Copy link
Contributor Author

lindexi commented Aug 9, 2022

Thank you @mattleibow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] sk_fontmgr_match_family_style must input family name argument by utf8 string

2 participants