FontSize

Inheritance: java.lang.Object

All Implemented Interfaces: com.groupdocs.editor.htmlcss.css.properties.ICssProperty

public class FontSize implements ICssProperty

Represents a font size as a special unit or a length value, which specifies the size of the font (historically the width of the capital “M”).

Constructors

Constructor Description
FontSize()

Fields

Field Description
Medium Medium size.
XxSmall The very small absolute-size
XSmall The mediocre small absolute-size
Small The normally small absolute-size
Large The normally large absolute-size
XLarge The mediocre large absolute-size
XxLarge The very large absolute-size
Larger Larger relative-size - font will be larger relative to the parent element’s font-size, roughly by the ratio used to separate the absolute-size keywords above.
Smaller Smaller relative-size - font will be smaller relative to the parent element’s font-size, roughly by the ratio used to separate the absolute-size keywords above.

Methods

Method Description
isInitial() Indicates whether this font-size has an initial value (Medium)
getValue() Returns a value of this font size as a string
isLengthDefined() Indicates whether this font-size is defined with a Length value
getLength() A length value, if this font-size was defined with it, or throwed exception otherwise
isAbsoluteSize() Indicates whether this font-size is defined with an absolute size as a keyword, based on the user’s default font size (which is medium)
isRelativeSize() Indicates whether this font-size is defined with an relative size as a keyword.
equals(FontSize other) Determines whether this font-size instance is equal to specified
equals(Object obj) Determines whether this font-size instance is equal to specified uncasted
hashCode() Returns a hash-code for this instance
op_Equality(FontSize first, FontSize second) Checks whether two “FontSize” values are equal
op_Inequality(FontSize first, FontSize second) Checks whether two “FontSize” values are not equal
fromLength(Length length) Creates a font-size from specified length
tryParse(String keyword, FontSize[] result) Tries to recognize a specified keyword as a proper keyword value of the ‘font-size’ and return it on success or NULL on failure.

FontSize()

public FontSize()

Medium

public static final FontSize Medium

Medium size. Initial value.

XxSmall

public static final FontSize XxSmall

The very small absolute-size

XSmall

public static final FontSize XSmall

The mediocre small absolute-size

Small

public static final FontSize Small

The normally small absolute-size

Large

public static final FontSize Large

The normally large absolute-size

XLarge

public static final FontSize XLarge

The mediocre large absolute-size

XxLarge

public static final FontSize XxLarge

The very large absolute-size

Larger

public static final FontSize Larger

Larger relative-size - font will be larger relative to the parent element’s font-size, roughly by the ratio used to separate the absolute-size keywords above.

Smaller

public static final FontSize Smaller

Smaller relative-size - font will be smaller relative to the parent element’s font-size, roughly by the ratio used to separate the absolute-size keywords above.

isInitial()

public final boolean isInitial()

Indicates whether this font-size has an initial value (Medium)

Returns: boolean

getValue()

public final String getValue()

Returns a value of this font size as a string

Returns: java.lang.String

isLengthDefined()

public final boolean isLengthDefined()

Indicates whether this font-size is defined with a Length value

Returns: boolean

getLength()

public final Length getLength()

A length value, if this font-size was defined with it, or throwed exception otherwise

Returns: Length

isAbsoluteSize()

public final boolean isAbsoluteSize()

Indicates whether this font-size is defined with an absolute size as a keyword, based on the user’s default font size (which is medium)

Returns: boolean

isRelativeSize()

public final boolean isRelativeSize()

Indicates whether this font-size is defined with an relative size as a keyword. The font will be larger or smaller relative to the parent element’s font size, roughly by the ratio used to separate the absolute-size keywords.

Returns: boolean

equals(FontSize other)

public final boolean equals(FontSize other)

Determines whether this font-size instance is equal to specified

Parameters:

Parameter Type Description
other FontSize Other font-size instance

Returns: boolean - true if are equal, false otherwise

equals(Object obj)

public boolean equals(Object obj)

Determines whether this font-size instance is equal to specified uncasted

Parameters:

Parameter Type Description
obj java.lang.Object Other uncasted font-size instance, may be null

Returns: boolean - true if are equal, false if not equal, null or of other type

hashCode()

public int hashCode()

Returns a hash-code for this instance

Returns: int - Hash-code as an signed integer

op_Equality(FontSize first, FontSize second)

public static boolean op_Equality(FontSize first, FontSize second)

Checks whether two “FontSize” values are equal

Parameters:

Parameter Type Description
first FontSize First value to check
second FontSize Second value to check

Returns: boolean - true if are equal, false otherwise

op_Inequality(FontSize first, FontSize second)

public static boolean op_Inequality(FontSize first, FontSize second)

Checks whether two “FontSize” values are not equal

Parameters:

Parameter Type Description
first FontSize First value to check
second FontSize Second value to check

Returns: boolean - false if are equal, true otherwise

fromLength(Length length)

public static FontSize fromLength(Length length)

Creates a font-size from specified length

Parameters:

Parameter Type Description
length Length A length value, cannot be unitless or negative

Returns: FontSize - New FontSize instance

tryParse(String keyword, FontSize[] result)

public static boolean tryParse(String keyword, FontSize[] result)

Tries to recognize a specified keyword as a proper keyword value of the ‘font-size’ and return it on success or NULL on failure.

Parameters:

Parameter Type Description
keyword java.lang.String A keyword to parse
result FontSize[] Result, of parsing was successful, or #Medium.Medium otherwise

Returns: boolean - true if parsing was successful, false otherwise