IMathPhantom

All Implemented Interfaces: com.aspose.slides.IMathElement

public interface IMathPhantom extends IMathElement

Represents a phantom math object (<m:phant>) that affects the layout of its child element without necessarily displaying it. A phantom can hide its base expression while preserving its width, height, or depth to align formulas or reserve space. Visibility and geometry behavior are controlled by properties such as Show, ZeroWid, ZeroAsc, ZeroDesc, and Transp.


Example:
 
 IMathPhantom phantom = new MathPhantom(new MathematicalText("1/2"));
 phantom.setShow(false);          // Hide the content
 phantom.setZeroWidth(false);     // Keep the width

Methods

MethodDescription
getBase()Base argument
getShow()Gets or sets a value indicating whether the base element is displayed.
setShow(boolean value)Gets or sets a value indicating whether the base element is displayed.
getZeroWidth()Gets or sets a value indicating whether the width of the base element should be treated as zero.
setZeroWidth(boolean value)Gets or sets a value indicating whether the width of the base element should be treated as zero.
getZeroAsc()Gets or sets a value indicating whether the ascent (height above baseline) of the base element should be treated as zero.
setZeroAsc(boolean value)Gets or sets a value indicating whether the ascent (height above baseline) of the base element should be treated as zero.
getZeroDesc()Gets or sets a value indicating whether the descent (depth below baseline) of the base element should be treated as zero.
setZeroDesc(boolean value)Gets or sets a value indicating whether the descent (depth below baseline) of the base element should be treated as zero.
getTransp()Gets or sets a value indicating whether the phantom is transparent for class-based spacing rules.
setTransp(boolean value)Gets or sets a value indicating whether the phantom is transparent for class-based spacing rules.

getBase()

public abstract IMathElement getBase()

Base argument


Example:
 
 MathPhantom mathBar = new MathPhantom(new MathematicalText("x"));
 IMathElement base = mathBar.getBase();

Returns: IMathElement

getShow()

public abstract boolean getShow()

Gets or sets a value indicating whether the base element is displayed.


When false, the base element is hidden but may still occupy space depending on other phantom settings. Corresponds to the OMML attribute m:show.

Returns: boolean

setShow(boolean value)

public abstract void setShow(boolean value)

Gets or sets a value indicating whether the base element is displayed.


When false, the base element is hidden but may still occupy space depending on other phantom settings. Corresponds to the OMML attribute m:show.

Parameters:

ParameterTypeDescription
valueboolean

getZeroWidth()

public abstract boolean getZeroWidth()

Gets or sets a value indicating whether the width of the base element should be treated as zero.


When true, the phantom does not reserve horizontal space for its base. Corresponds to the OMML attribute m:zeroWid.

Returns: boolean

setZeroWidth(boolean value)

public abstract void setZeroWidth(boolean value)

Gets or sets a value indicating whether the width of the base element should be treated as zero.


When true, the phantom does not reserve horizontal space for its base. Corresponds to the OMML attribute m:zeroWid.

Parameters:

ParameterTypeDescription
valueboolean

getZeroAsc()

public abstract boolean getZeroAsc()

Gets or sets a value indicating whether the ascent (height above baseline) of the base element should be treated as zero.


When true, the phantom does not raise the baseline of the surrounding math line. Corresponds to the OMML attribute m:zeroAsc.

Returns: boolean

setZeroAsc(boolean value)

public abstract void setZeroAsc(boolean value)

Gets or sets a value indicating whether the ascent (height above baseline) of the base element should be treated as zero.


When true, the phantom does not raise the baseline of the surrounding math line. Corresponds to the OMML attribute m:zeroAsc.

Parameters:

ParameterTypeDescription
valueboolean

getZeroDesc()

public abstract boolean getZeroDesc()

Gets or sets a value indicating whether the descent (depth below baseline) of the base element should be treated as zero.


When true, the phantom does not lower the baseline of the surrounding math line. Corresponds to the OMML attribute m:zeroDesc.

Returns: boolean

setZeroDesc(boolean value)

public abstract void setZeroDesc(boolean value)

Gets or sets a value indicating whether the descent (depth below baseline) of the base element should be treated as zero.


When true, the phantom does not lower the baseline of the surrounding math line. Corresponds to the OMML attribute m:zeroDesc.

Parameters:

ParameterTypeDescription
valueboolean

getTransp()

public abstract boolean getTransp()

Gets or sets a value indicating whether the phantom is transparent for class-based spacing rules.


When true, operators and symbols inside the phantom still affect mathematical spacing around the phantom (as if visible). When false, class-based spacing is ignored. Corresponds to the OMML attribute m:transp.

Returns: boolean

setTransp(boolean value)

public abstract void setTransp(boolean value)

Gets or sets a value indicating whether the phantom is transparent for class-based spacing rules.


When true, operators and symbols inside the phantom still affect mathematical spacing around the phantom (as if visible). When false, class-based spacing is ignored. Corresponds to the OMML attribute m:transp.

Parameters:

ParameterTypeDescription
valueboolean