The Text object class can display fixed size text, using the standard X bitmap font technology or scalable text, using an outlined font technology provided with the INT library. Resource XmNtextScale is used to control whether fixed size or scalable fonts are used. If resource XmNtextScale is NULL, a fixed size font will be used. The size of this font, specified using resource XmNfontSize, must be a valid X font size. Otherwise, if resource XmNtextScale is not NULL, a scalable font is used. The size of scalable text object is specified in user coordinates. Its size will change when the coordinate system changes (for example if you resize the parent widget window).
When using scalable text, the Text object must access a file containing the description of the outline for the specified font. The font descriptions must reside in a directory which you can specify as follows:
If neither of these is defined, the current directory will be searched. If a valid font description is not found, a default stroke font will be used.
The Text object supports rotation for both fixed size and scalable text.
The position of the text is specified in user coordinates using structure XintTextLocation and resource XmNtextLocation. The positioning of the text relative to this location is controlled by resources XmNhorizontalTextAlignment and XmNverticalTextAlignment.
| Name | Type | Default | Access |
|---|---|---|---|
| XmNfontFamily | int | XintHELVETICA | CSG |
| XmNfontSize | int | 10 | CSG |
| XmNfontSlant | int | XintSLANT_REGULAR | CSG |
| XmNfontWeight | int | XintWEIGHT_MEDIUM | CSG |
| XmNhorizontalTextAlignment | int | XintHALIGN_LEFT | CSG |
| XmNmarginHeight | Dimension | 4 | CSG |
| XmNmarginWidth | Dimension | 4 | CSG |
| XmNrotateAngle | int | 0 | CSG |
| XmNtextLocation | XintTextLocation * | NULL | CSG |
| XmNtextScale | XintTextScale * | NULL | CSG |
| XmNtextString | char * | NULL | CSG |
| XmNverticalTextAlignment | int | XintVALIGN_TOP | CSG |
| Resource Value | Description |
|---|---|
| XintDEFAULT | Use the default font family. For scalable text, a stroke font is selected. For fixed size text, the default X font for the specified size and weight is selected. |
| XintHELVETICA (default) | Use the Helvetica font family. |
| XintTIMES | Use the Times font family. |
| XintCOURIER | Use the Courier font family. |
| XintNEW_CENTURY_SCHOOLBOOK | Use the New Century Schoolbook font family |
| XintSYMBOL | Use the Symbol font family. |
| Resource Value | Description |
|---|---|
| XintHALIGN_LEFT | Text is aligned left in the horizontal direction. |
| XintHALIGN_CENTER | Text is centered in the horizontal direction. |
| XintHALIGN_RIGHT | Text is aligned right in the horizontal direction. |
typedef struct {
float x;
float y;
} XintTextLocation;
typedef struct {
float size;
float stretch;
} XintTextScale;
| Resource Value | Description |
|---|---|
| XintVALIGN_TOP | Text is aligned with respect to the top in the vertical direction. |
| XintVALIGN_CENTER | Text is centered in the vertical direction. |
| XintVALIGN_BOTTOM | Text is aligned with respect to the bottom in the vertical direction. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the XEvent that triggered the callback. |
| Boolean | doit | Set to False to cancel the operation. |
| XintTextLocation | old_location | Old location of the Text object. |
| XintTextLocation | location | New location proposed for the Text object. |
Object XintCreateText (...)
| Widget | parent | Parent of new Text object. |
| char * | name | Name of new Text object. |
| ArgList | arglist | List of resource/value items. |
| Cardinal | argcount | Number of items in arglist. |
Boolean XintIsText (Object object)