Class SVGFontUtilities

java.lang.Object
org.apache.batik.bridge.SVGFontUtilities
All Implemented Interfaces:
XMLConstants, CSSConstants, SVGConstants

public abstract class SVGFontUtilities extends Object implements SVGConstants
Utility class for SVG fonts.
Version:
$Id: SVGFontUtilities.java 1804130 2017-08-04 14:41:11Z ssteiner $
  • Constructor Details

    • SVGFontUtilities

      public SVGFontUtilities()
  • Method Details

    • getFontFaces

      public static List getFontFaces(Document doc, BridgeContext ctx)
    • getFontFamily

      public static GVTFontFamily getFontFamily(Element textElement, BridgeContext ctx, String fontFamilyName, String fontWeight, String fontStyle)
      Given a font family name tries to find a matching SVG font object. If finds one, returns an SVGFontFamily otherwise returns an UnresolvedFontFamily.
      Parameters:
      textElement - The text element that the font family will be attached to.
      ctx - The bridge context, used to search for a matching SVG font element.
      fontFamilyName - The name of the font family to search for.
      fontWeight - The weight of the font to use when trying to match an SVG font family.
      fontStyle - The style of the font to use when trying to match as SVG font family.
      Returns:
      A GVTFontFamily for the specified font attributes. This will be unresolved unless a matching SVG font was found.
    • getFontWeightNumberString

      protected static String getFontWeightNumberString(String fontWeight)
      Returns a string that contains all of the font weight numbers for the specified font weight attribute value.
      Parameters:
      fontWeight - The font-weight attribute value.
      Returns:
      The font weight expressed as font weight numbers. e.g. "normal" becomes "400".