QFontMetrics

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QFontMetrics(native: NativeElement): QFontMetrics

Overrides Component.constructor

Parameters:

NameType
nativeNativeElement

Returns: QFontMetrics

+ new QFontMetrics(qfont: QFont): QFontMetrics

Overrides Component.constructor

Parameters:

NameType
qfontQFont

Returns: QFontMetrics

+ new QFontMetrics(qfontmetrics: QFontMetrics): QFontMetrics

Overrides Component.constructor

Parameters:

NameType
qfontmetricsQFontMetrics

Returns: QFontMetrics

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

ascent

ascent(): number

Returns the ascent of the font

Returns: number


averageCharWidth

averageCharWidth(): number

Returns the average width of glyphs in the font

Returns: number


capHeight

capHeight(): number

Returns the cap height of the font

Returns: number


descent

descent(): number

Returns the descent of the font

Returns: number


fontDpi

fontDpi(): number

Returns the font DPI

Returns: number


height

height(): number

Returns the height of the font

Returns: number


horizontalAdvance

horizontalAdvance(text: string, len: number): number

Returns the horizontal advance in pixels of the first len characters of text. If len is negative (the default), the entire string is used

Parameters:

NameTypeDefault
textstring-
lennumber-1

Returns: number


inFont

inFont(text: string): number

Returns true if character ch is a valid character in the font; otherwise returns false

Parameters:

NameType
textstring

Returns: number


leading

leading(): number

Returns the leading of the font

Returns: number


leftBearing

leftBearing(text: string): number

Returns the left bearing of character ch in the font

Parameters:

NameType
textstring

Returns: number


lineSpacing

lineSpacing(): number

Returns the distance from one base line to the next

Returns: number


lineWidth

lineWidth(): number

Returns the width of the underline and strikeout lines, adjusted for the point size of the font

Returns: number


overlinePos

overlinePos(): number

Returns the distance from the base line to where an overline should be drawn

Returns: number


rightBearing

rightBearing(text: string): number

Returns the right bearing of character ch in the font

Parameters:

NameType
textstring

Returns: number


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

Returns: void


size

size(flags: TextFlag, text: string, tabStops: number): QSize

Returns the size in pixels of text

See QtEnums::TextFlag for flags

Parameters:

NameTypeDefault
flagsTextFlag-
textstring-
tabStopsnumber0

Returns: QSize


strikeOutPos

strikeOutPos(): number

Returns the distance from the base line to where the strikeout line should be drawn

Returns: number


swap

swap(other: QFontMetrics): void

Swaps metrics other with this metrics. This operation is very fast and never fails

Parameters:

NameType
otherQFontMetrics

Returns: void


underlinePos

underlinePos(): number

Returns the distance from the base line to where an underscore should be drawn

Returns: number