Font - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


DocumentTools[Layout]

  

Font

  

generate XML for a Font element

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Font( str, opts )

Parameters

str

-

(optional) ; a string of text

opts

-

(optional) ; one or more keyword options as described later

Options

• 

background : {list(nonnegint),symbol,string}:=[255,255,255] ; The background color for text. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of non-negative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [255,255,255] which corresponds to white.

• 

bold : truefalse:=false ; Whether text will be shown in bold.

• 

color : {list(nonnegint),symbol,string}:=[0,0,0] ; The foreground color for text. The passed value can be either a named color or a list of three integers each between 0 and 255. A list of nonnegative integers is interpreted as RGB values in a 24bit 3-channel color space. The default value is [0,0,0] which corresponds to black.

• 

encoding : identical("UTF-8"):=NULL ; Indicates that UTF-8 encoding shall be used. The default is NULL.

• 

family : identical("Times New Roman","Courier","DejaVu Sans","DejaVu Serif","Helvetica","Lucida Sans"):="Times New Roman" ; The font family to be used for displayed text.

• 

italic : truefalse:=false ; Whether text will be shown in italics.

• 

opaque : truefalse ; Whether the background color will be opaque, in which case any underlying color such as the fillcolor of a Table Cell will show. The default value is false when background is white, and true otherwise.

• 

size : posint:=12 ; The size of the text font.

• 

style : identical(Text,Hyperlink):=Text ; A worksheet style for text.

• 

superscript : truefalse:=false ; Whether the text will be displayed in the superscript position.

• 

underline : truefalse:=false ; Whether text will be shown underlined.

Description

• 

The Font command provides a modifier for a string of text appearing in a Textfield.

• 

An Font element is returned as an XML function call.

• 

The generated XML may be used with the results of additional commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document may be inserted into the current document using the InsertContent command.

Examples

withDocumentTools:

withDocumentTools:-Layout:

Executing the Font command produces a function call.

FFontSome text

F_XML_Fontsize=12,mathsize=12,mathvariant=normal,style=Text,background=[255,255,255],mathbackground=[255,255,255],foreground=[0,0,0],mathcolor=[0,0,0],family=Times New Roman,Some text

(1)

By using additional commands from the Layout Constructors package a nested function call can be produced which represents an entire worksheet.

xmlWorksheetGroupInputTextfieldF:

That XML representation of a worksheet can be inserted directly.

InsertContentxml:

Some text

Size and color can be specified as options.

FFontSome text,size=20,color=0,150,0,background=255,255,120:InsertContentWorksheetGroupInputTextfieldF:

Some text

FFontSome text,size=20,color=blue,background=Orange:InsertContentWorksheetGroupInputTextfieldF:

Some text

Each of the bold, italic, and underline options can be used independently.

FFontSome text,size=20,bold:InsertContentWorksheetGroupInputTextfieldF:

Some text

FseqFontText,size=20,opf, ,fincombinat:-powersetunderline,bold,italic:InsertContentWorksheetGroupInputTextfieldF:

Text Text Text Text Text Text Text Text 

The font family may be specified as an option.

FFontSome text,size=20,color=DarkCyan,family=DejaVu Sans:InsertContentWorksheetGroupInputTextfieldF:

Some text

Text may be placed in a superscript position.

FMFontM,size=20:FEFonte,size=20,superscript:InsertContentWorksheetGroupInputTextfieldFM,FE:

Me

The worksheet's hyperlink style can be respected.

FFontSome text,size=16,color=blue,style=:-Hyperlink:InsertContentWorksheetGroupInputTextfieldF:

Some text

By default a background other than white is opaque with respect to an underlying shade such as the fillcolor of a Table Cell. And by default a white background is not opaque. In either case the opaque option can be used to force the behavior.

ssize=16,The quick brown fox jumps over the lazy dog:cffillcolor=0,120,150:F1Fonts,background=Orange:F2Fonts,background=Orange,opaque=false:F3Fonts,background=Orange,opaque=true:F4Fonts:F5Fonts,opaque=false:F6Fonts,opaque=true:TTablealignment=center,width=50,seqRowCellcf,Fi,i=1..6:InsertContentWorksheetT:

The quick brown fox jumps over the lazy dog

The quick brown fox jumps over the lazy dog

The quick brown fox jumps over the lazy dog

The quick brown fox jumps over the lazy dog

The quick brown fox jumps over the lazy dog

The quick brown fox jumps over the lazy dog

Compatibility

• 

The DocumentTools:-Layout:-Font command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

Cell

Component Constructors

DocumentTools

InsertContent

Layout Constructors

Table

Textfield

XMLTools