FontStyle: String Sets the fontStyle of Chart Title. FontStyle can be set to one of the below options. Default: “normal” Options: “normal”, “italic”, “oblique”. I have a label with text in Bold and Italic. I want to change those font properties through a button click. I got to know of the code Label1.Font = new Font(Label1.Font, FontStyle.Regular); But.
LaTeX normally chooses the appropriate font and font size based on the logical structureof the document (e.g. sections). In some cases, you may want to set fonts and sizes by hand.
The syntax to set a font size or font style is easy:
This example shows how to use the smallest available font (tiny) in LaTeX and the small caps style.
Font sizes are identified by special names, the actual size is not absolute but relative to the font size declared in the documentclass
statement (see Creating a document in LaTeX).
In the example, {huge huge font size}
declares that the text inside the braces must be formatted in a huge font size. For a complete list of available font sizes see the reference guide.
By default, in standard LaTeX classes the serif typeface (a.k.a. roman) font is used. The other font typefaces (sans serif and typewriter, a.k.a. monospace) can be used by entering some specific commands
You can set up the use of sans font as a default in LaTeX document by using the command:
Similarly, for using roman font as a default:
Open an example in Overleaf
The most common font styles in LaTeX are bold, italics and underlined, but there are a few more.
In the example at the introduction the small caps style was used. In this case the textsl
command sets the slanted style which makes the text look a bit like italics but not quite. See the reference guide for a complete list of font styles.
If you want to go back to 'normal' font style (default for the LaTeX class you are using), this can be done by using the textnormal{..}
command or the normalfont
switch command.
Font sizes
Command | Output |
---|---|
tiny | |
scriptsize | |
footnotesize | |
small | |
normalsize | |
large | |
Large | |
LARGE | |
huge | |
Huge |
Default font families
typeface = family | command | switch command | output |
---|---|---|---|
serif (roman) | textrm{Sample Text 0123} | rmfamily | |
sans serif | textsf{Sample Text 0123} | sffamily | |
typewriter (monospace) | texttt{Sample Text 0123} | ttfamily |
Font styles
style | command | switch command | output |
---|---|---|---|
medium | textmd{Sample Text 0123} | mdseries | |
bold | textbf{Sample Text 0123} | bfseries | |
upright | textup{Sample Text 0123} | upshape | |
italic | textit{Sample Text 0123} | itshape | |
slanted | textsl{Sample Text 0123} | slshape | |
small caps | textsc{Sample Text 0123} | scshape |
For more information see:
textShadowOffset
#Type | Required |
---|---|
object: {width: number,height: number} | No |
color
#Type | Required |
---|---|
color | No |
fontSize
#Type | Required |
---|---|
number | No |
fontStyle
#Type | Required |
---|---|
enum('normal', 'italic') | No |
fontWeight
#Specifies font weight. The values 'normal' and 'bold' are supported for most fonts. Not all fonts have a variant for each of the numeric values, in that case the closest one is chosen.
Type | Required |
---|---|
enum('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') | No |
lineHeight
#Type | Required |
---|---|
number | No |
textAlign
#Specifies text alignment. The value 'justify' is only supported on iOS and fallbacks to left
on Android. Crotone 1920 kitsempty spaces the blog.
Type | Required |
---|---|
enum('auto', 'left', 'right', 'center', 'justify') | No |
textDecorationLine
#Type | Required |
---|---|
enum('none', 'underline', 'line-through', 'underline line-through') | No |
textShadowColor
#Type | Required |
---|---|
color | No |
fontFamily
#Type | Required |
---|---|
string | No |
textShadowRadius
#Type | Required |
---|---|
number | No |
includeFontPadding
#Set to false
to remove extra font padding intended to make space for certain ascenders / descenders. With some fonts, this padding can make text look slightly misaligned when centered vertically. For best results also set textAlignVertical
to center
. Default is true.
Type | Required | Platform |
---|---|---|
bool | No | Android |
textAlignVertical
#Type | Required | Platform |
---|---|---|
enum('auto', 'top', 'bottom', 'center') | No | Android |
fontVariant
#Type | Required | Platform |
---|---|---|
array of enum('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') | No | iOS, Android >= 5.0 |
letterSpacing
#Type | Required | Platform |
---|---|---|
number | No | iOS, Android >= 5.0 |
textDecorationColor
#Type | Required | Platform |
---|---|---|
color | No | iOS |
textDecorationStyle
#Type | Required | Platform |
---|---|---|
enum('solid', 'double', 'dotted', 'dashed') | No | iOS |
textTransform
#Type | Required |
---|---|
enum('none', 'uppercase', 'lowercase', 'capitalize') | No |
writingDirection
#Type | Required | Platform |
---|---|---|
enum('auto', 'ltr', 'rtl') | No | iOS |