xaml - How can I specify letter spacing or kerning, in a WPF TextBox? -
i'd modify spacing between characters in wpf textbox.
letter-spacing: 5px
thing available in css.
think possible in xaml; what's simplest way?
i found "introduction glyphrun object , glyphs element" document, , found exceedingly unhelpful.
this code example page:
<!-- "hello world!" explicit character widths proportional font --> <glyphs fonturi = "c:\windows\fonts\arial.ttf" fontrenderingemsize = "36" unicodestring = "hello world!" indices = ",80;,80;,80;,80;,80;,80;,80;,80;,80;,80;,80" fill = "maroon" originx = "50" originy = "225" />
the same documentation page gives "explanation" indices
property does:
i have no idea of means. i'm not sure indices right thing - comment in code speaks of "character widths" don't care about. want adjust width between characters.
also, there no example how apply glyphs
element textbox. when tried it, wpf test app crashed.
what want increase empty space appears between drawn characters within wpf textbox. text vary in length , content. have modify indicies
property every time there new character? there way "make 20% more space usual, every character".
can me?
i tried glyphs , fontstretch , couldn't result looking for. able come approach works purposes. maybe work others, well.
<itemscontrol itemssource="{binding somestring}"> <itemscontrol.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal" /> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatemplate> <textblock text="{binding}" margin="0,0,5,0"/> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol>
i can bind string , don't need character width detection set spacing properly. right margin space between letters.
example:
Comments
Post a Comment