User Tools

Site Tools


Font

DAZScript wrapper for QFont.

More...

Inherits :

Properties

Constructors

DAZ Script
Font ()
Font ( Font font )
Font ( String familyName )

Methods

DAZ Script
RectboundingRect ( Rect maxRect, String text, Number flags=0 )
StringelidedText ( String text, DzWidget::TextElideMode mode, Number width, Number flags=0 )
Arrayfamilies ()
ArraypointSizes ( String family, String style )
Sizesize ( String text, Number flags=0 )
Arraystyles ( String family )

Detailed Description

This is the DAZScript counterpart to the QFont type used in the DAZ Studio SDK.

Attention:

  • Inheritance will change to Object in a pending update.

Properties


Boolean : bold

Holds whether or not the Font is bolded.


String : family

Holds the family name of the Font.


Boolean : italic

Holds whether or not the Font is italicized.


Number : pixelSize

The pixel size of the font (the device dependent size of the font)


Number : pointSize

The point size of the font (the device independent size of the font)


Boolean : strikeout

Holds whether or not the Font is striked.


Boolean : underline

Holds whether or not the Font is underlined.

Constructors


Font()

Default Constructor.


Font( Font font )

Copy Constructor.

Parameter(s):

  • font - The Font to copy.

Font( String familyName )

Constructs a new font of the given family.

Parameter(s):

  • familyName - The name of the font family that the new font will be of.

Methods


Rect : boundingRect( Rect maxRect, String text, Number flags=0 )

Parameter(s):

Return Value:

  • The bounding rectangle of the characters in text, which is the set of pixels the text would cover if drawn at (0, 0), constrained to maxRect.

Since:

  • 4.10.0.121

String : elidedText( String text, DzWidget::TextElideMode mode, Number width, Number flags=0 )

Parameter(s):

  • text - The text to get an elided version of.
  • mode - The mode to elide the text with.
  • width - The width (in pixels) to test text with.
  • flags - Currently only supports DzWidget::TextShowMnemonic.

Return Value:

  • If text is wider than width, an elided version of text, otherwise the original string.

Since:

  • 4.10.0.121

Array : families()

Return Value:

  • A list of the font families available on the current machine (if any), otherwise an empty list.

Since:

  • 4.10.0.121

Array : pointSizes( String family, String style )

Parameter(s):

  • family - The name of the font family to get sizes for.
  • style - The style of the font family to get sizes for.

Return Value:

  • A list of the point sizes for the font specified by family and style.

Since:

  • 4.10.0.121

Size : size( String text, Number flags=0 )

Parameter(s):

Return Value:

  • The size (in pixels) of text.

Since:

  • 4.10.0.121

Array : styles( String family )

Parameter(s):

  • family - The name of the font family to get styles for.

Return Value:

  • A list of the styles for the font specified by family (if any), otherwise an empty list.

Since:

  • 4.10.0.121