Closed xanather closed 10 years ago
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: @xanather may i ask how you are doing this red outline rendering? do you just offset it 4 (or 8) times when before drawing the black font? or do you have some shader in place?
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
Issue stems from the change at https://github.com/sharpdx/SharpDX/issues/86 https://github.com/sharpdx/SharpDX/commit/060f9b7363e55959a75a27066b9cfa70e3fa4fe7
Thanks, I did some tests but the fix was not working well with fixed fonts and spaces at the beginning of the line. After checking and using the same rule as DirectXTk, It is working well with fixed font like "Courier New" as well as "Arial". Let me know if there is still an issue
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!