SharpDX Toolkit SpriteBatch.DrawString issue #236
Comments
I can confirm this. Also, the space (" ") returns font.MeasureString().X value of 0. In XNA, it would return the actual width of the space (I'm guessing based on whatever the maximum character block would be). |
This is not related to the actual topic, but: |
I first draw the red outline (4 drawstring calls) at offsets (-1, 0), (1, 0), (0, -1), (0, 1) and then draw the black text over it (no offset). |
https://github.com/sharpdx/SharpDX/blob/master/Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteFont.cs#L402 Is this the issue? I have a feeling its not the actual imported Glyph measurements since all characters can be drawn/measured fine IF they are not the first character. |
Any thoughts as to why this might happen? Its the only bug ive found on SharpDX TK and I rather would not code around it. |
I had no time to look into this. This code is inherited from SpriteFont from DirectXTk. If you take the time to dig into this issue and fix it that would be helpful |
Well I do owe this project alot, I will give it a shot. This is also a time for me to solve the requirements on compiling on Windows 7. |
Edit: I was copying over the Input library instead of the Graphics library, silly me :) Should have fix soon |
Thanks, I did some tests but the fix was not working well with fixed fonts and spaces at the beginning of the line. |
Edit: going to make another issue. |
Spritebatch seems to be drawing/measuring letters that are 1 pixel in width incorrectly.
For example (textbox from within my game):
Compiled font file used (generated by tkfont.exe)
http://www.xanather.com/Main.font.zip
This issue only happens if characters such as "i", "I" (upper case i) and "l" (lower case L) are the first letters in the string. Any of them characters that are not at index zero will be measured correctly.
This is the only actual issue that Ive had with SharpDX toolkit after moving over a large code base from MonoGame. Amazing!
The text was updated successfully, but these errors were encountered: