


If you are using a custom layout, DirectWrite has support for setting character spacing with IDWriteTextAnalyzer1::Appl圜haracterSpacing. The SetCharacterSpacing method takes in the amount of space you want before and after the character, the minimum advance allowed, and a DWRITE_TEXT_RANGE that defines the range to apply the spacing. Use the SetCharacterSpacing on a DWriteTextLayout1 interface to apply your own character spacing to the text in the layout. Use the GetCharacterSpacing method to determine the current character spacing and it returns the current character, the spacing before and after the character, the minimum advance width, and a DWRITE_TEXT_RANGE structure that contains information about the starting position and length of the remaining text. If you are using the DirectWrite layout, you can use the IDWriteTextLayout1::GetCharacterSpacing and IDWriteTextLayout1::SetCharacterSpacing methods for this purpose.

Starting with Windows 8, DirectWrite adds these methods here to control the spacing of characters in your text. The second line increases character spacing, and the third line decreases the character spacing.

The first line applies no tracking to the text. Character spacingĬharacter spacing, also known as "tracking", is the spacing between characters in a run of text.
#TYPETOOL EDIT KERNING PAIRS UPDATE#
While I know its easy enough to re-create the font asset using the font creator tool, or update the font atlas (or reset the font asset) in the inspector window,, this becomes really problematic for Arabic font assets - especially considering that there is so much manual entry of glyph adjustment, mark-to-mark adjustment, and mark-to-base adjustment records that needs to be done before the Arabic text can render correctly with all diacritical marks, and unfortunately all that data doesn't get saved upon re-creating, updating or resetting the font assets.Starting with Windows 8, DirectWrite provides a number of features that allow you to control basic typographic, layout, and spacing features, such as character spacing, pair kerning, and justification. I was, however, able to re-assign the source font, but applying that change to the font asset required the clearing "the font asset's character, glyph, and texture data". I wasn't able to re-assign the font material manually (as it was greyed out on the font asset's inspector). What is the recommended way for reusing TMP font assets from project to project? I tried exporting and importing them as a part of an asset package, but the reference to the font material disappeared (as well as the reference to the source font itself). Creating these records from scratch each time is a very time consuming. The copied Glyph pair adjustment table would act as a master data table (or template) that includes the glyph pair combinations that require custom kerning/adjustment. Single glyph kerning/adjustment for Fatha isn't sufficient here and the same goes for all other diacritical marks.Ĭopying the Glyph pair adjustment table record data from one font asset to another would allow one to make the necessary tweaks to the records to make the other Arabic fonts appear correctly. For example, the Arabic diacritic Fatha (short 'a' sound) doesn't always appear above the Arabic letter when displayed in Unity (it often overlaps with the letter it is supposed to be above), and different fonts have different letter heights, so the amount of yPlacement needed for the diacritic Fatha would vary for each font and each letter combination involving Fatha as the second character. Different Arabic fonts appear differently in the TMP and require different glyph pair adjustments to make them appear correctly in Unity. Yes, I'd like to copy it to a different Arabic font asset that uses a different font source. Click to expand.Thanks for your reply, Stephan.
