org.apache.poi.xslf.usermodel

## Class XSLFFontInfo

- java.lang.Object
- - org.apache.poi.xslf.usermodel.XSLFFontInfo

- All Implemented Interfaces:
    FontInfo

      public class XSLFFontInfo
      extends java.lang.Object
      implements FontInfo

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XSLFFontInfo(XMLSlideShow ppt, org.openxmlformats.schemas.presentationml.x2006.main.CTEmbeddedFontListEntry fontListEntry)`
    `XSLFFontInfo(XMLSlideShow ppt, java.lang.String typeface)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FontFacet` | `addFacet(java.io.InputStream fontData)`
    `static XSLFFontInfo` | `addFontToSlideShow(XMLSlideShow ppt, java.io.InputStream fontStream)` Adds or updates a (MTX-) font
    `FontCharset` | `getCharset()`
    `java.util.List<FontFacet>` | `getFacets()` If font facets are embedded in the document, return the list of embedded facets.
    `FontFamily` | `getFamily()`
    `static java.util.List<XSLFFontInfo>` | `getFonts(XMLSlideShow ppt)` Return all registered fonts
    `byte[]` | `getPanose()`
    `FontPitch` | `getPitch()`
    `java.lang.String` | `getTypeface()`
    `void` | `setCharset(FontCharset charset)` Sets the charset
    `void` | `setFamily(FontFamily family)` Sets the font family class
    `void` | `setPitch(FontPitch pitch)` Set the font pitch
    `void` | `setTypeface(java.lang.String typeface)` Sets the font name

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.poi.common.usermodel.fonts.FontInfo

      `getIndex, setIndex, setPanose`

- - ### Constructor Detail

    - #### XSLFFontInfo

          public XSLFFontInfo(XMLSlideShow ppt,
                              java.lang.String typeface)

    - #### XSLFFontInfo

          public XSLFFontInfo(XMLSlideShow ppt,
                              org.openxmlformats.schemas.presentationml.x2006.main.CTEmbeddedFontListEntry fontListEntry)

  - ### Method Detail

    - #### getTypeface

          public java.lang.String getTypeface()

      Specified by:
        `getTypeface` in interface `FontInfo`
      Returns:
        the full name of the font, i.e. font family + type face

    - #### setTypeface

          public void setTypeface(java.lang.String typeface)

      Description copied from interface: `FontInfo`
      Sets the font name
      Specified by:
        `setTypeface` in interface `FontInfo`
      Parameters:
        `typeface` - the full name of the font, when `null` removes the font definition - removal is implementation specific

    - #### getCharset

          public FontCharset getCharset()

      Specified by:
        `getCharset` in interface `FontInfo`
      Returns:
        the font charset

    - #### setCharset

          public void setCharset(FontCharset charset)

      Description copied from interface: `FontInfo`
      Sets the charset
      Specified by:
        `setCharset` in interface `FontInfo`
      Parameters:
        `charset` - the charset

    - #### getFamily

          public FontFamily getFamily()

      Specified by:
        `getFamily` in interface `FontInfo`
      Returns:
        the family class

    - #### setFamily

          public void setFamily(FontFamily family)

      Description copied from interface: `FontInfo`
      Sets the font family class
      Specified by:
        `setFamily` in interface `FontInfo`
      Parameters:
        `family` - the font family class

    - #### getPitch

          public FontPitch getPitch()

      Specified by:
        `getPitch` in interface `FontInfo`
      Returns:
        the font pitch or `null` if unsupported

    - #### setPitch

          public void setPitch(FontPitch pitch)

      Description copied from interface: `FontInfo`
      Set the font pitch
      Specified by:
        `setPitch` in interface `FontInfo`
      Parameters:
        `pitch` - the font pitch

    - #### getPanose

          public byte[] getPanose()

      Specified by:
        `getPanose` in interface `FontInfo`
      Returns:
        panose info in binary form or `null` if unknown

    - #### getFacets

          public java.util.List<FontFacet> getFacets()

      Description copied from interface: `FontInfo`
      If font facets are embedded in the document, return the list of embedded facets. The font embedding is experimental, therefore the API can change.
      Specified by:
        `getFacets` in interface `FontInfo`
      Returns:
        the list of embedded EOT font data

    - #### addFacet

          public FontFacet addFacet(java.io.InputStream fontData)
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### addFontToSlideShow

          public static XSLFFontInfo addFontToSlideShow(XMLSlideShow ppt,
                                                        java.io.InputStream fontStream)
                                                 throws java.io.IOException

      Adds or updates a (MTX-) font
      Parameters:
        `ppt` - the slideshow which will contain the font
        `fontStream` - the (MTX) font data as stream
      Returns:
        a font data object
      Throws:
        `java.io.IOException` - if the font data can't be stored
      Since:
        POI 4.1.0

    - #### getFonts

          public static java.util.List<XSLFFontInfo> getFonts(XMLSlideShow ppt)

      Return all registered fonts
      Parameters:
        `ppt` - the slideshow containing the fonts
      Returns:
        the list of registered fonts

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.