You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[API Proposal]: Trim friendly Font ToLogFont/FromLogFont #8846
Right now WinForm use System.Drawing.Common.Font.ToLogFont/FromLogFont with their own interop structures. That API produce trimming warning. This API would serve same purpose as existing API, but provide trim friendly alternative.
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]publicunsafestructMyLOGFONT{publicintlfHeight;publicintlfWidth;publicintlfEscapement;publicintlfOrientation;publicintlfWeight;publicbytelfItalic;publicbytelfUnderline;publicbytelfStrikeOut;publicbytelfCharSet;publicbytelfOutPrecision;publicbytelfClipPrecision;publicbytelfQuality;publicbytelfPitchAndFamily;privatefixedchar_lfFaceName[LF_FACESIZE];}// And similar varf=newFont();MyLOGFONTinteropStruct=default;f.ToLogFont(refinteropStruct);
Alternative Designs
Ask users of this API, reimplement it itself within their application and make that code trim-friendly.
@JeremyKuhne@RussKie, given that there's already a PR up for the implementation, should this get reviewed in one of the api design review meetings? Would anyone of you want to be the champion for it?
Activity
[-][API Proposal]: [/-][+][API Proposal]: Trim friendly Font ToLogFont/FromLogFont[/+]ViktorHofer commentedon Jun 7, 2022
@JeremyKuhne @RussKie, given that there's already a PR up for the implementation, should this get reviewed in one of the api design review meetings? Would anyone of you want to be the champion for it?
JeremyKuhne commentedon Jun 7, 2022
@ViktorHofer sure, mark it and I'll represent.
RussKie commentedon Jun 7, 2022
I'll watch the recording
ViktorHofer commentedon Jun 8, 2022
Great, thank you. Sent out a mail.
terrajobst commentedon Jun 8, 2022
How urgent is this?
ViktorHofer commentedon Jun 29, 2022
@kant2002 can you answer @terrajobst's question regarding the priority of getting this into main?
4 remaining items
bartonjs commentedon Aug 9, 2022
Video
elachlan commentedon Jan 18, 2023
Now the API change is approved, can we reopen dotnet/runtime#70224?
ViktorHofer commentedon Jan 23, 2023
@kant2002 feel free to re-open your PR and we can give it another glance.
Introduce AOT friendly version of ToLogFont and FromLogFont
elachlan commentedon Mar 14, 2023
@kant2002 did you want to reroll your patch now
System.Drawinghas moved to winforms?JeremyKuhne commentedon Apr 14, 2023
I've implemented this and will be putting up a PR tomorrow.
Implement typed Font.To/FromLogFont
Implement typed Font.To/FromLogFont (#8994)