Ā Ā https://github.com/wxWidgets/wxWidgets/pull/26657
(1Ā file)
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This hopefully addresses #19275
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Looks good, thanks, I think we can merge this even just before 3.3.3.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This would be awesome! š
Thanks for your fast response!
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@PBfordev commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
Does using #ifdef really works here, as D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT is not a define but an enumerator of D2D1_DRAW_TEXT_OPTIONS enum, both in the Windows SDK and mingw-w64.
Perhaps just ORing with hardcoded 4 with an explaining comment would be better, as suggested elsewhere...
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
Oh, good point, it definitely does not work. Now I wonder whether this has actually been tested?
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
Actually I'm not sure if this symbol is still missing from any SDKs by now, maybe we could remove the compile-time test.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@tobiolo pushed 1 commit.
ā
View it on GitHub or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@tobiolo commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
Thanks for the feedback. I removed the compile time check and just placed 4. Is it ok now?
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@tobiolo pushed 1 commit.
ā
View it on GitHub or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
I was thinking of just using the symbolic constant and checking if any of the CI jobs had trouble with it.
But most of all I thought that you did test it and checked that emojis were rendered correctly and it's worrisome that you didn't because now I have no idea if it works or not.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@tobiolo commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
I will double-check.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@tobiolo commented on this pull request.
> @@ -4852,11 +4852,22 @@ void wxD2DContext::DoDrawText(const wxString& str, wxDouble x, wxDouble y)
textLayout->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING);
}
+ D2D1_DRAW_TEXT_OPTIONS drawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
+
+#ifdef D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp
index 5801bbdfea..727cf1d668 100644
--- a/samples/drawing/drawing.cpp
+++ b/samples/drawing/drawing.cpp
@@ -1100,9 +1100,12 @@ void MyCanvas::DrawText(wxDC& dc)
dc.DrawRotatedText(text , dc.FromDIP(400), dc.FromDIP(400), n);
}
- dc.SetFont( wxFontInfo(18).Family(wxFONTFAMILY_SWISS) );
+ wxFont emojiFont(wxFontInfo(18).FaceName("Twemoji"));
+ dc.SetFont(emojiFont);
+
+ dc.DrawText( wxString( "š", wxConvUTF8 ), dc.FromDIP(110), dc.FromDIP(40) );
- dc.DrawText( "This is Swiss 18pt text.", dc.FromDIP(110), dc.FromDIP(40) );
+ dc.SetFont( wxFontInfo(18).Family(wxFONTFAMILY_SWISS) );
wxCoord length;
wxCoord height;
I have this in the samples but I cannot verify :-( I'm using Wine here so it can be either unsupported by Wine or something not correct towards the Direct2D API.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
I have tested that it works on Windows 11
wx-d2d-clr-emoji.png (view on web)
with
diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 5801bbdfea..95c8bcf761 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -1082,6 +1082,11 @@ void MyCanvas::DrawDefault(wxDC& dc) void MyCanvas::DrawText(wxDC& dc) { + dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); + dc.SetFont(wxFontInfo(12).FaceName("Segoe UI Emoji")); + dc.DrawText(wxString::FromUTF8("\U0001F44D"), dc.FromDIP(10), dc.FromDIP(10)); + return; + // set underlined font for testing dc.SetFont( wxFontInfo(12).Family(wxFONTFAMILY_MODERN).Underlined() ); dc.DrawText( "This is text", dc.FromDIP(110), dc.FromDIP(10) );
TBH, I don't like testing for the OS version during every draw text call, even when I do understand that the call cost is small, considering everything. I would still set-up the drawing options once, e.g. as wxD2DContext class member.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz pushed 2 commits.
ā
View it on GitHub or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Let's try if this compiles. It does work, even under Windows 10.
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thanks @vadz and @PBfordev for your review and the further development in this PR!
ā
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()