Open manutiedra opened 5 hours ago
Hi! You probably want to leave the scaling (first parameter to the TextSpacing
constructor) to 1 and change the increment (i.e. the second parameter instead). For example:
TextSpacing spacing = new TextSpacing(1, 3);
frameContent.FillText(xPos, yPos, text, font, color, spacing: spacing, textBaseline: TextBaselines.Middle);
This is because if you change the increment, the amount of space that is added is the same for every letter (which is what you want); instead, if you change the scale, the amount of added space is proportional to the letter width (hence, less space is added after I
than after A
).
You can have a look at the interactive example here and see how it works!
I was trying to add some spacing between the letters using a non standard font family and it didn't shown as I expected.
Then I tried the standard font family and it also is not showing as I expected.
Here you can see what I've got using VectSharp:
The first font is https://fonts.google.com/specimen/Nova+Square The second one is FontFamily.StandardFontFamilies.HelveticaBold
If I do the same in illustrator, setting the tracking to a high value I've got this:
That looks a lot better.
I'm drawing the text with VectSharp using:
Is the TextSpacing working as expected? How can I achieve spacing like illustrator does?