Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Graphics
Legacy Graphics
Windows GDI
Fonts and Text
 SetTextCharacterExtra function
SetTextCharacterExtra function

Applies to: desktop apps only

The SetTextCharacterExtra function sets the intercharacter spacing. Intercharacter spacing is added to each character, including break characters, when the system writes a line of text.

Syntax

int SetTextCharacterExtra(
  __in  HDC hdc,
  __in  int nCharExtra
);

Parameters

hdc [in]

A handle to the device context.

nCharExtra [in]

The amount of extra space, in logical units, to be added to each character. If the current mapping mode is not MM_TEXT, the nCharExtra parameter is transformed and rounded to the nearest pixel.

Return value

If the function succeeds, the return value is the previous intercharacter spacing.

If the function fails, the return value is 0x80000000.

Remarks

This function is supported mainly for compatibility with existing applications. New applications should generally avoid calling this function, because it is incompatible with complex scripts (scripts that require text shaping; Arabic script is an example of this).

The recommended approach is that instead of calling this function and then TextOut, applications should call ExtTextOut and use its lpDx parameter to supply widths.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Fonts and Text Overview
Font and Text Functions
DrawText
GetTextCharacterExtra
TextOut

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker