Kerning is a font setting that’s important in Word and PowerPoint. We’ll explain kerning and why you mostly don’t have to worry about it. Kerning adjusts the horizontal space between letters so they look right to the human eye.
-->Returns or sets the minimum font size for which Microsoft Word will adjust kerning automatically. Read/write Single.
Syntax
expression. Kerning
expression An expression that returns a Font object.
Example
Select the Kerning for fonts check box, and then specify a point size. Check the results in the Preview box. To make the new formatting options the default for all new Word documents, click Default, and then click Yes. Kerning is the contextual spacing adjustment between pairs or triplets of letters. Specific spacing between sets of characters can increase readability and make text look better. The important difference between kerning and character spacing is the fact that letter spacing is agnostic to the text it spaces, while kerning is used in certain situations between certain pairs of characters as defined in the font. 2016-6-7 Microsoft will argue the point because you can use the Format Font - Advanced - Character Spacing dialog to alter the spacing between characters. If you want to adjust less than an entire word, select only those characters, then use the Spacing setting to choose either Expanded or Condensed. The amount defaults to 1 pt but can be adjusted in 1. Expression An expression that returns a Font object. This example sets the minimum font size for automatic kerning to 12 points or larger in the active document. ActiveDocument.Content.Font.Kerning = 12 This example displays the minimum font size for which Word will automatically adjust kerning in the selected text. Automatic kerning is what we’re talking about here. Microsoft Office takes the kerning information in the font and calculates the kerning necessary in Word, PowerPoint or Excel. More sophisticated graphics packages allow for manual kerning or adjustment. 2020-3-31 Formatting a document with the many tools offered in Word 2011 for Mac is a piece of cake. You can make a document look however you need it to look. Just follow these tips to adjust the spacing between lines and paragraphs. Adjusting the space between lines To.
This example sets the minimum font size for automatic kerning to 12 points or larger in the active document.
This example displays the minimum font size for which Word will automatically adjust kerning in the selected text.
See also
Mso Font Kerning
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
-->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.
Character spacing
Character spacing, also known as 'tracking', is the spacing between characters in a run of text.
Here is an example of tracking. The first line applies no tracking to the text. The second line increases character spacing, and the third line decreases the character spacing.
Starting with Windows 8, DirectWrite adds these methods here to control the spacing of characters in your text.
If you are using the DirectWrite layout, you can use the IDWriteTextLayout1::GetCharacterSpacing and IDWriteTextLayout1::SetCharacterSpacing methods for this purpose.
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.
Use the SetCharacterSpacing on a DWriteTextLayout1 interface to apply your own character spacing to the text in the layout. 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.
If you are using a custom layout, DirectWrite has support for setting character spacing with IDWriteTextAnalyzer1::ApplyCharacterSpacing. Use this method if you require a custom text layout in order to have advanced control over your layout. This method allows you to provide ApplyCharacterSpacing with the leading and trailing spacing, minimum advance width, length of the cluster map, number of glyphs, mapping from character ranges to glyphs, and advance width of each glyph if you use a custom layout. The method returns the modified glyph advances and a DWRITE_GLYPH_OFFSET enumeration with the new offsets to the origin of each glyph.
Kerning
Kerning is the contextual spacing adjustment between pairs or triplets of letters. Specific spacing between sets of characters can increase readability and make text look better. The important difference between kerning and character spacing is the fact that letter spacing is agnostic to the text it spaces, while kerning is used in certain situations between certain pairs of characters as defined in the font.
The image her is an example of kerning. The word AVATAR on the top line is kerned in order to make the word look more natural. As you can see from the red boxes around the characters, there is more spacing applied between the first four letters, while the R on the end has more space before it. The original text without kerning is on the second line. The kerning in this example makes the word more readable and more natural.
Kerning Syndrome
The character advances between pairs of characters that the font kerns are stored in the kern table and DirectWrite parses that table and returns the information to you through the kerning APIs.
If you want to know whether or not a font supports pair kerning, you can use the IDWriteFontFace1::HasKerningPairs method. This method returns a bool value of 1 if the font supports kerning pairs.
The IDWriteFontFace1 also has a method that allows you to get access to the kerning pair adjustments for glyph indices. GetKerningPairAdjustments allows you to input an array of glyph indices and DirectWrite returns an array of glyph advance adjustments. If a font doesn't support the kern table, the method returns zeroes for the glyph advance adjustments.
If you are using the DirectWrite layout, there are two methods on the IDWriteTextLayout1 interface that allow you to set pair kerning and learn more about pair kerning in the layout. The SetPairKerning method takes in a Boolean representation of whether or not you want pair kerning enabled and a DWRITE_TEXT_RANGE that defines the range of text to apply it to. If you want to learn whether or not pair kerning is enabled on a text range you can use the GetPairKerning method, which takes in the current position and returns a bool corresponding to whether or not pair kerning is enabled, and the text range that the kerning setting applies to.
Justification
Justification is the process of aligning text so that it fills all the space within a column by increasing the advances between characters or glyph clusters or adding justification characters to achieve the same effect. In general, this is accomplished by determining where space needs to be added to a line of text, and inserting spacing characters in those breaking opportunities. These spacing elements can differ as well, in Latin scripts, text is justified by increasing the advance widths between elements, while in Arabic, text is justified with a kashida. Here is an example of Arabic and Latin script both justified and not justified.
Starting with Windows 8, DirectWrite has a number of methods that allow you to justify text in your apps.
There is an additional value in the DWRITE_TEXT_ALIGNMENT enumeration. You can use the SetTextAlignment method and pass in the DWRITE_TEXT_ALIGNMENT_JUSTIFIED constant and DirectWrite justifies the text and inserts the appropriate justification character for the script. Microsoft internet explorer for mac 10.6.8.
If you are using a custom layout have a number of methods available so you can take advantage of justification. DirectWrite has three methods on the IDWriteTextAnalyzer1 interface that you can use to add justification to a custom layout.
The first method is GetJustificationOpportunities, which takes in the text that you want to justify and returns a DWRITE_JUSTIFICATION_OPPORTUNITY structure that outlines where justification characters can be added to justify the text.
Kern
The second function is JustifyGlyphAdvances, which justifies an array of glyph advances so that they fit the line width. This method takes in the DWRITE_JUSTIFICATION_OPPORTUNITY structure that GetJustificationOpportunities generates, the glyph advances, and the glyph offsets. It then generates the justified glyph advances and a DWRITE_GLYPH_OFFSET enumeration that contains the justified glyph offsets.
The third function is GetJustifiedGlyphs, which fills in the new glyphs for complex scripts where justification has increased the advances for glyphs. GetJustifiedGlyphs only needs to be called if the script has a specific justification character as returned by GetScriptProperties. This method takes in information about the font, length of the text, em size of the glyphs, script of the text, number of glyphs, cluster map, original glyph advances/offsets, justified glyph advances/offsets, and glyph properties. The method returns the actual glyph count, updated cluster map, updated glyph indices with inserted justification glyphs, updated glyph offsets, and updated glyph advances.