CSGetMaxCharWidth Function
Description
Returns the maximum char width of the Consoul window font.
Syntax
VB/A 32bits
Private Declare Function CSGetMaxCharWidth Lib "consoul_010205_32.dll" ( _
ByVal hWnd As Long _
) As Integer
VB/A 64bits
Private Declare PtrSafe Function CSGetMaxCharWidth Lib "consoul_010205_64.dll" ( _
ByVal hWnd As LongPtr _
) As Integer
Return Value
The return value is the maximum char width of the Consoul window font (specified at window creation time, see CSCreateLogWindow).
Parameters
hWnd
The window handle (HWND) of the Consoul window, as returned by CSCreateLogWindow.
Remarks
To help dealing with non monospaced (ie non proportional) fonts, Consoul exposes other functions, like CSGetCharWidth and CSTextWidth. Consoul extended vt100 escapes like VT100X_ADVANCEABS/REL
or text fragmentation techniques (like AsciiPaint does) can also help with proportional fonts.
This function internally uses the Win32 GetTextMetrics
API to query for font information and returns the tmMaxCharWidth
member of the TEXTMETRIC
structure.
Last updated: May 13 2022.