Class SVGFontUtilities

    • Constructor Detail

      • SVGFontUtilities

        public SVGFontUtilities()
    • Method Detail

      • getFontFaces

        public static java.util.List getFontFaces​(org.w3c.dom.Document doc,
                                                  BridgeContext ctx)
      • getFontFamily

        public static GVTFontFamily getFontFamily​(org.w3c.dom.Element textElement,
                                                  BridgeContext ctx,
                                                  java.lang.String fontFamilyName,
                                                  java.lang.String fontWeight,
                                                  java.lang.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 java.lang.String getFontWeightNumberString​(java.lang.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".