c# - Font rendering with custom font widths using Xamarin.iOS -
i'm using xamarin.ios , need render text strings have custom amount of spacing between each gylph. building nsmutableattributedstring in passing font , paragraphstyple information. been able display text string need able set custom amount of spacing between each gylph. there dictionary element can add allow me configure value in ios? below method using build attributedstring.
public nsmutableattributedstring build() { // create new attributed string text var atts = new nsmutableattributedstring(string); var attrange = new nsrange(0, atts.length); var attsdic = new nsmutabledictionary(); var fontobject = new nsobject(font.handle); attsdic.add((nsstring)"nsfont", fontobject); var alignmentsettings = new ctparagraphstylesettings() { alignment = cttextalignment.left, }; var paragraphstyle = new ctparagraphstyle(alignmentsettings); var psobject = new nsobject(paragraphstyle.handle); attsdic.add((nsstring)"nsparagraphstyle", psobject); atts.setattributes(attsdic, attrange); return atts; }
Comments
Post a Comment