Need with DirectWrite rendering issue description in commentsFFmpeg bitrate issuePopulate a memory array of 64K words – each word is 20 bits wide – out of 1K by 4 bit memory chips. How many such chips will you need?I need help on Bit TwiddlingC# Rotate bits to left overflow issueSaturating arithmetic issues with warningsLaravel 4.2 BIT datatype issueLaravel 5 : How to render bit fieldbitwise operators and shifts issues in cNeed help understanding Python CodeRendering bitstring from phoenix view
Is it expected that a reader will skip parts of what you write?
How to communicate to my GM that not being allowed to use stealth isn't fun for me?
Does a scale have more than seven chords?
How can I end combat quickly when the outcome is inevitable?
A IP can traceroute to it, but can not ping
Colloquialism for “see you later”
Winning Strategy for the Magician and his Apprentice
How can I make some of my chapters "come to life"?
Compiling C files on Ubuntu and using the executable on Windows
Implement Own Vector Class in C++
Union with anonymous struct with flexible array member
Is using haveibeenpwned to validate password strength rational?
Is White controlling this game?
Playing a Character as Unobtrusive and Subservient, Yet Not Passive
Is it a problem if <h4>, <h5> and <h6> are smaller than regular text?
Is it possible to have a wealthy country without a middle class?
Fixing obscure 8080 emulator bug?
Is the term 'open source' a trademark?
Geopandas and QGIS Calulating Different Polygon Area Values?
Wooden cooking layout
Non-disclosure agreement in a small business
Why would future John risk sending back a T-800 to save his younger self?
English word for "product of tinkering"
Medieval flying castle propulsion
Need with DirectWrite rendering issue description in comments
FFmpeg bitrate issuePopulate a memory array of 64K words – each word is 20 bits wide – out of 1K by 4 bit memory chips. How many such chips will you need?I need help on Bit TwiddlingC# Rotate bits to left overflow issueSaturating arithmetic issues with warningsLaravel 4.2 BIT datatype issueLaravel 5 : How to render bit fieldbitwise operators and shifts issues in cNeed help understanding Python CodeRendering bitstring from phoenix view
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Here's the relevant bits of code - error handling etc. is omitted for clarity.
D2D1_BITMAP_PROPERTIES1 bp;
bp.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
bp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
bp.dpiX = 96.0f;
bp.dpiY = 96.0f;
bp.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
bp.colorContext = nullptr;
...
d2dDeviceContext->SetTarget(targetBitmap);
....
writeFactory->CreateTextFormat(L"Arial", nullptr, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 32.0f, L"en-US", &textFormatAccountCreds);
textFormatAccountCreds->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
textFormatAccountCreds->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
std::wostringstream outAccountName;
outAccountName CreateTextLayout(outAccountName.str().c_str(), (UINT32)outAccountName.str().size(), textFormatAccountCreds, (float)800,
(float)600, &textLayoutAccountName);
const float color[4] = 1.0f, 0.5f, 0.3f, 1.0f ;
immediateContext->ClearRenderTargetView(renderTargetView, color);
d2dDeviceContext->BeginDraw();
d2dDeviceContext->DrawTextLayout(D2D1::Point2F(2.0f, 5.0f), textLayoutAccountName, blackBrush);
d2dDeviceContext->EndDraw();
swapChain->Present(0, 0);
As you can see in the screenshot, the text is rendering very poorly - letters are cut off, etc. I can change the size / position and the rendering issues manifest differently, but they still persist.
What am I missing here? I've been through most of the DirectWrite docs on MSDN and it's not clear what my problem is. I do see some mention that I should specify the starting position of my text relative to the dpi scale, but the example is very vague.
It's also worth mentioning that I'm using Direct3D and DirectWrite with Direct2D all together, in a similar fashion as seen in this tutorial. Not sure if that's causing my problem.
I would be very grateful for any assistance. Thanks much.
bit
add a comment |
Here's the relevant bits of code - error handling etc. is omitted for clarity.
D2D1_BITMAP_PROPERTIES1 bp;
bp.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
bp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
bp.dpiX = 96.0f;
bp.dpiY = 96.0f;
bp.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
bp.colorContext = nullptr;
...
d2dDeviceContext->SetTarget(targetBitmap);
....
writeFactory->CreateTextFormat(L"Arial", nullptr, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 32.0f, L"en-US", &textFormatAccountCreds);
textFormatAccountCreds->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
textFormatAccountCreds->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
std::wostringstream outAccountName;
outAccountName CreateTextLayout(outAccountName.str().c_str(), (UINT32)outAccountName.str().size(), textFormatAccountCreds, (float)800,
(float)600, &textLayoutAccountName);
const float color[4] = 1.0f, 0.5f, 0.3f, 1.0f ;
immediateContext->ClearRenderTargetView(renderTargetView, color);
d2dDeviceContext->BeginDraw();
d2dDeviceContext->DrawTextLayout(D2D1::Point2F(2.0f, 5.0f), textLayoutAccountName, blackBrush);
d2dDeviceContext->EndDraw();
swapChain->Present(0, 0);
As you can see in the screenshot, the text is rendering very poorly - letters are cut off, etc. I can change the size / position and the rendering issues manifest differently, but they still persist.
What am I missing here? I've been through most of the DirectWrite docs on MSDN and it's not clear what my problem is. I do see some mention that I should specify the starting position of my text relative to the dpi scale, but the example is very vague.
It's also worth mentioning that I'm using Direct3D and DirectWrite with Direct2D all together, in a similar fashion as seen in this tutorial. Not sure if that's causing my problem.
I would be very grateful for any assistance. Thanks much.
bit
add a comment |
Here's the relevant bits of code - error handling etc. is omitted for clarity.
D2D1_BITMAP_PROPERTIES1 bp;
bp.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
bp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
bp.dpiX = 96.0f;
bp.dpiY = 96.0f;
bp.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
bp.colorContext = nullptr;
...
d2dDeviceContext->SetTarget(targetBitmap);
....
writeFactory->CreateTextFormat(L"Arial", nullptr, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 32.0f, L"en-US", &textFormatAccountCreds);
textFormatAccountCreds->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
textFormatAccountCreds->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
std::wostringstream outAccountName;
outAccountName CreateTextLayout(outAccountName.str().c_str(), (UINT32)outAccountName.str().size(), textFormatAccountCreds, (float)800,
(float)600, &textLayoutAccountName);
const float color[4] = 1.0f, 0.5f, 0.3f, 1.0f ;
immediateContext->ClearRenderTargetView(renderTargetView, color);
d2dDeviceContext->BeginDraw();
d2dDeviceContext->DrawTextLayout(D2D1::Point2F(2.0f, 5.0f), textLayoutAccountName, blackBrush);
d2dDeviceContext->EndDraw();
swapChain->Present(0, 0);
As you can see in the screenshot, the text is rendering very poorly - letters are cut off, etc. I can change the size / position and the rendering issues manifest differently, but they still persist.
What am I missing here? I've been through most of the DirectWrite docs on MSDN and it's not clear what my problem is. I do see some mention that I should specify the starting position of my text relative to the dpi scale, but the example is very vague.
It's also worth mentioning that I'm using Direct3D and DirectWrite with Direct2D all together, in a similar fashion as seen in this tutorial. Not sure if that's causing my problem.
I would be very grateful for any assistance. Thanks much.
bit
Here's the relevant bits of code - error handling etc. is omitted for clarity.
D2D1_BITMAP_PROPERTIES1 bp;
bp.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
bp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
bp.dpiX = 96.0f;
bp.dpiY = 96.0f;
bp.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
bp.colorContext = nullptr;
...
d2dDeviceContext->SetTarget(targetBitmap);
....
writeFactory->CreateTextFormat(L"Arial", nullptr, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL, 32.0f, L"en-US", &textFormatAccountCreds);
textFormatAccountCreds->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
textFormatAccountCreds->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
std::wostringstream outAccountName;
outAccountName CreateTextLayout(outAccountName.str().c_str(), (UINT32)outAccountName.str().size(), textFormatAccountCreds, (float)800,
(float)600, &textLayoutAccountName);
const float color[4] = 1.0f, 0.5f, 0.3f, 1.0f ;
immediateContext->ClearRenderTargetView(renderTargetView, color);
d2dDeviceContext->BeginDraw();
d2dDeviceContext->DrawTextLayout(D2D1::Point2F(2.0f, 5.0f), textLayoutAccountName, blackBrush);
d2dDeviceContext->EndDraw();
swapChain->Present(0, 0);
As you can see in the screenshot, the text is rendering very poorly - letters are cut off, etc. I can change the size / position and the rendering issues manifest differently, but they still persist.
What am I missing here? I've been through most of the DirectWrite docs on MSDN and it's not clear what my problem is. I do see some mention that I should specify the starting position of my text relative to the dpi scale, but the example is very vague.
It's also worth mentioning that I'm using Direct3D and DirectWrite with Direct2D all together, in a similar fashion as seen in this tutorial. Not sure if that's causing my problem.
I would be very grateful for any assistance. Thanks much.
bit
bit
asked Mar 24 at 18:11
Remy TwaiRemy Twai
183
183
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326920%2fneed-with-directwrite-rendering-issue-description-in-comments%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326920%2fneed-with-directwrite-rendering-issue-description-in-comments%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown