fontAdjust()

This function adjusts the font attributes (specified via the mapping parameter) for the given font (specified via the font string).

Synopsis

string fontAdjust(string font, mapping parameter);

Parameters

Parameters Meaning
font A font string, e.g.

"Arial,-1,17,5,75,0,0,0,0,0,Bold"

and a mapping parameter such as "pixelSize" or "italic" - see chapter fontToMapping()

See also the example at the end of this chapter.

Return value

An adjusted font string.

Description

This function takes a specified font string and a mapping,which can be filled with one or more of the mapping-key/value pairs returned by the function fontToMapping(). The function adjusts the font attributes (specified via the mapping parameter) for the given font (specified via the font string). The return value is an adjusted font string.

Example

The example add entries to a tree widget and changes the font of the tree widget.

//The example adds the entries to the tree widget:
main()
{
  TREE1.addColumn("SURNAME");
  TREE1.addColumn("FIRST NAME");
  TREE1.addColumn("ADDRESS");
  TREE1.appendItemNC("","WHOLE NAME","WHOLE_NAME");
  TREE1.appendItemNC("WHOLE NAME","ADAM","Adam");
  TREE1.appendItemNC("WHOLE NAME","COLLINS","Collins");
  TREE1.appendItemNC("WHOLE NAME","MOORE",makeDynString("Moore","Jane","Main street. 100"));
  TREE1.setText("ADAM", 1, "John");
  TREE1.setText("COLLINS", 1, "Emma");
  TREE1.setText("ADAM",2, "Ocean road. 1");
  TREE1.setText("COLLINS",2, "Corn street. 15");
  this.font("Arial,-1,13,5,50,0,0,0,0,0,Regular");
}  
//The example returns the font string of the tree widget and changes the normal font to "italic":
main(mapping event)
{
  string fontStr = TREE1.getFont("WHOLE NAME", 2);
  string adjustStr;
  adjustStr = fontAdjust(fontStr, makeMapping("italic", true));
  TREE1.font(adjustStr);
 }

Assignment

Mapping functions

Availability

UI