How can I specify letter spacing or kerning, in a WPF TextBox?

前端 未结 3 635
既然无缘
既然无缘 2020-12-05 11:07

I\'d like to modify the spacing between characters in a WPF TextBox.
Something like the letter-spacing: 5px thing that is available in CSS.
I think it i

3条回答
  •  抹茶落季
    2020-12-05 11:33

    I tried Glyphs and FontStretch and couldn't easily get the result I was looking for. I was able to come up with an approach that works for my purposes. Maybe it will work for others, as well.

    
        
            
                
            
        
        
            
                
            
        
    
    

    I can bind to any string and don't need to do any character width detection to set the spacing properly. The right margin is the space between the letters.

    Example:

    Kerning

提交回复
热议问题