I'm rendering text in Direct2D/DirectWrite, but calling SetLineSpacing()
on either TextFormat or TextLayout seems to have no effect. Does anyone know why?
views:
234answers:
6Am i missing something?
Neither IDWriteTextFormat nor IDWriteTextLayout has a SetLineHeight function ...
Have you checked the HRESULT
error code returned by SetLineSpacing()
?
Hint: If you're using Visual Studio just type eax,hr
in one of the debug Watch windows to see any possible error code right after the call.
I'm 99% sure that this is a bug. I have done a little playing around with Direct2D lately and also had a problem with SetLineSpacing()
on TextLayout, think it is the same as what you are describing, in that case I can confirm that it's not just you. Reopen your bug report on MS Connect, it has been closed.
minimum supported client: Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista.
Do you run any of the above stated versions of windows? I believe the reason why you aren't seeing any changes is because any version below the ones states above doesn't support the SetLineSpacing() in DirectWrite.
I even have the same problem as Dmitri Nesteruk said.
However, I find out that if you set the lineSpacing "after CreateTextLayout", SetLineSpacing cannot work.
Otherwise, if you set LineSpacing before CreateTextLayout, it can work now.
Maybe you can try this soluton.
PS: My env. is in Window Vista SP2.
Many thanks.