4

How can I get kerning adjustment of space between 2 given chars in .NET? In WPF application?

For example, lets say I have font Times New Roman of size 22 that is bold. What kerning will be used for characters A and v ? How can I get this value in my WPF application ?

If you wander why do I need it: I want to make H.B.'s answer to my question Create guitar chords editor in WPF to work with kerning.

Community
  • 1
  • 1
Rasto
  • 17,000
  • 40
  • 141
  • 232
  • 1
    I just did some digging to see if any approach leapt out. Found the following that might help you: In WPF kerning only works with OpenType fonts. You can get kerning info using the GetKerningPairs method in the winapi, so you could pInvoke that from .net code. – David Hall Apr 27 '11 at 19:51
  • @David Hall: Can you please provide some code sample with that call to winapi ? I have never used winapi before... Goggling it right now but not getting it yet. If you like to post it as an answer it might be very well be the accepted one (nobody seems to know better solution :( ) . – Rasto Apr 27 '11 at 20:19
  • I don't understand your problem completely, but I tried to look through what you had in your previous question, and I'd suggest looking into the WPF Glyphs class (http://msdn.microsoft.com/en-us/library/ms601126(v=VS.100).aspx). It may make your solution easier. – K Mehta Jul 04 '11 at 06:23

0 Answers0