-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Introduce AOT friendly version of ToLogFont and FromLogFont #81082
Conversation
These methods used by WinForms Closes #70358
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-drawing Issue DetailsThese methods used by WinForms
|
@kant2002 can you please add tests for the new APIs? |
cc: @JeremyKuhne |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments should be updated and there are still some test issues. Other than that the implementation looks good.
@@ -291,6 +291,29 @@ public unsafe void ToLogFont(object logFont, Graphics graphics) | |||
} | |||
} | |||
|
|||
/// <summary> | |||
/// Update the given LOGFONT with data from given graphics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use the wording in the existing docs. This applies to all of the overloads you're adding.
@@ -888,6 +1039,25 @@ public class LOGFONT | |||
public string lfFaceName; | |||
} | |||
|
|||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] | |||
public struct LOGFONT_Struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably unnecessary. You're inadvertently using this (incorrect) struct in the positive tests. Just using an existing struct (say, Point
) should be sufficient for the negative tests.
using (FontFamily family = FontFamily.GenericMonospace) | ||
{ | ||
IntPtr lpFaceName = Marshal.StringToCoTaskMemAuto(family.Name); | ||
var logFont = new LOGFONT_Struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOGFONT_Struct
isn't a valid definition of LOGFONT
.
@kant2002 we just recently migrated System.Drawing.Common to dotnet/winforms and need to port this PR over to winforms. cc @JeremyKuhne |
These methods used by WinForms
Closes dotnet/winforms#8846