Gets the named font with the specified style, correctly scaled
@param name
@param style
@return the named font with the specified style, correctly scaled
164307
public static Font getFont (String name, int style) {
		return new Font(name, style, getDefaultFont().getSize());
	}
1319742
private static FontStyle intToFontStyle(int style) {
        switch (style) {
        case java.awt.Font.PLAIN:
            return FontStyle.PLAIN;
        case java.awt.Font.BOLD:
            return FontStyle.BOLD;
        case java.awt.Font.ITALIC:
            return FontStyle.ITALIC;
        case java.awt.Font.BOLD + java.awt.Font.ITALIC:
            return FontStyle.BOLD_ITALIC;
        default:
            return FontStyle.PLAIN;
        }
    }
1235444
private String getFontName(TermList list, CSSProperty.FontWeight weight, CSSProperty.FontStyle style)
    {
        for (Term<?> term : list)
        {
            Object value = term.getValue();
            if (value instanceof CSSProperty.FontFamily)
                return ((CSSProperty.FontFamily) value).getAWTValue();
            else
            {
                String name = lookupFont(value.toString(), weight, style);
                if (name != null) return name;
            }
        }
        //nothing found, use Serif
        return java.awt.Font.SERIF;
    }
1029812
def get_font(section='appearance', option='font', font_size_delta=0):
    """"""
    font = FONT_CACHE.get((section, option))

    if font is None:
        families = CONF.get(section, option+"/family", None)

        if families is None:
            return QFont()

        family = get_family(families)
        weight = QFont.Normal
        italic = CONF.get(section, option+'/italic', False)

        if CONF.get(section, option+'/bold', False):
            weight = QFont.Bold

        size = CONF.get(section, option+'/size', 9) + font_size_delta
        font = QFont(family, size, weight)
        font.setItalic(italic)
        FONT_CACHE[(section, option)] = font

    size = CONF.get(section, option+'/size', 9) + font_size_delta
    font.setPointSize(size)
    return font
498343
static CTFont resolveFont (Font font) {
    CTFont ctFont = fonts.get(font == null ? DEFAULT_FONT : font);
    if (ctFont == null) {
      String iosName = getVariant(font.name, font.style);
      fonts.put(font, ctFont = CTFont.create(iosName, font.size, CGAffineTransform.Identity()));
    }
    return ctFont;
  }
26267
@Override
  public Font getFont( AttributeSet attr )
  {
    boolean bUnderline = StyleConstants.isUnderline( attr );
    boolean bStrikethrough = StyleConstants.isStrikeThrough( attr );

    if( !bUnderline && !bStrikethrough )
    {
      // StyleContext ignores the Underline and Strikethrough attribute
      return getFont( attr, getFontFamily( attr ) );
    }

    // Must build the font via TextAttribute map to support Underlined and Strikethrough text

    Map<TextAttribute, Object> map = new HashMap<TextAttribute, Object>();
    map.put( TextAttribute.FAMILY, getFontFamily( attr ) );
    map.put( TextAttribute.SIZE, (float)getFontSize() );
    map.put( TextAttribute.WEIGHT, StyleConstants.isBold( attr ) ? TextAttribute.WEIGHT_BOLD : TextAttribute.WEIGHT_REGULAR );
    map.put( TextAttribute.POSTURE, StyleConstants.isItalic( attr ) ? TextAttribute.POSTURE_OBLIQUE : TextAttribute.POSTURE_REGULAR );
    if( bUnderline )
    {
      map.put( TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON );
      if( attr.getAttribute( DASHED ) != null )
      {
        map.put( TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_LOW_GRAY );
      }
    }
    if( bStrikethrough )
    {
      map.put( TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON );
    }

    Font font = _fontCache.get( attr );
    if( font == null )
    {
      font = new Font( map );
      _fontCache.put( attr, font );
    }

    return font;
  }
218984
public static String macroCase(String name) {
        return Strings.c_case(name).toUpperCase(Locale.US);
    }
1299908
public static function setStyleDefinition($name, Style $style) {
        if (!self::$styles) {
            self::$styles = self::initStyles();
        }

        self::$styles[$name] = $style;
    }
739461
public BaseFontParameters getBaseFontParameters(String name) {
        String alias = (String)aliases.get(name);
        if (alias == null)
            return (BaseFontParameters)mapper.get(name);
        BaseFontParameters p = (BaseFontParameters)mapper.get(alias);
        if (p == null)
            return (BaseFontParameters)mapper.get(name);
        else
            return p;
    }
544669
public T get(String name) {
        if (m_items == null) {
            return null;
        }
        return m_items.get(name.toUpperCase());
    }
138038
def document_style_by_name(name)
      root_object.document_styles.each do |style|
        return style if style.name == name
      end
      nil
    end
98962
public static String getCssCode(BandElement be, Map<String, Object> style, boolean needed) {

		StringBuilder css = new StringBuilder();
		if (needed) {
			if (style.containsKey(StyleFormatConstants.FONT_FAMILY_KEY)) {
				String val = (String) style.get(StyleFormatConstants.FONT_FAMILY_KEY);
				css.append(" font-family: ").append(val).append(" ;\n");
			}

			if (style.containsKey(StyleFormatConstants.FONT_SIZE)) {
				Float val = (Float) style.get(StyleFormatConstants.FONT_SIZE);
				css.append("font-size: ").append(val.intValue()).append("pt ;\n");
			}
		}
		
		if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
			Color val = (Color) style.get(StyleFormatConstants.FONT_COLOR);
			css.append("color: rgb(").append(val.getRed()).append(",").append(val.getGreen()).append(",").append(val.getBlue())
					.append(") ;\n");
		}
		if (style.containsKey(StyleFormatConstants.FONT_STYLE_KEY)) {
			if (StyleFormatConstants.FONT_STYLE_NORMAL.equals(style.get(StyleFormatConstants.FONT_STYLE_KEY))) {
				css.append("font-weight: normal ;\n");
				css.append("font-style: normal;  \n");
			}
			if (StyleFormatConstants.FONT_STYLE_BOLD.equals(style.get(StyleFormatConstants.FONT_STYLE_KEY))) {
				css.append("font-weight: bold; \n");
				css.append("font-style: normal;  \n");
			}
			if (StyleFormatConstants.FONT_STYLE_ITALIC.equals(style.get(StyleFormatConstants.FONT_STYLE_KEY))) {
				css.append("font-weight: normal; \n");
				css.append("font-style: italic;  \n");
			}
			if (StyleFormatConstants.FONT_STYLE_BOLDITALIC.equals(style.get(StyleFormatConstants.FONT_STYLE_KEY))) {
				css.append("font-weight: bold; \n");
				css.append("font-style: italic; \n");
			}
		}
		if (style.containsKey(StyleFormatConstants.BACKGROUND_COLOR)) {
			Color val = (Color) style.get(StyleFormatConstants.BACKGROUND_COLOR);
			if ((val.getRed() != 255) || (val.getGreen() != 255) || (val.getBlue() != 255)) {				
				css.append("background-color: rgb(").append(val.getRed()).append(",").append(val.getGreen()).append(",")
						.append(val.getBlue()).append(") ;\n");
			}
		}
		if (style.containsKey(StyleFormatConstants.HORIZONTAL_ALIGN_KEY)) {
			if (StyleFormatConstants.HORIZONTAL_ALIGN_LEFT.equals(style.get(StyleFormatConstants.HORIZONTAL_ALIGN_KEY))) {
				css.append("text-align:left; \n");
			}
			if (StyleFormatConstants.HORIZONTAL_ALIGN_RIGHT.equals(style.get(StyleFormatConstants.HORIZONTAL_ALIGN_KEY))) {
				css.append("text-align:right; \n");
			}
			if (StyleFormatConstants.HORIZONTAL_ALIGN_CENTER.equals(style.get(StyleFormatConstants.HORIZONTAL_ALIGN_KEY))) {
				css.append("text-align:center; \n");
			}
		}
		if (style.containsKey(StyleFormatConstants.VERTICAL_ALIGN_KEY)) {
			if (StyleFormatConstants.VERTICAL_ALIGN_MIDDLE.equals(style.get(StyleFormatConstants.VERTICAL_ALIGN_KEY))) {
				css.append("vertical-align:middle; \n");
			}
			if (StyleFormatConstants.VERTICAL_ALIGN_TOP.equals(style.get(StyleFormatConstants.VERTICAL_ALIGN_KEY))) {
				css.append("vertical-align:top; \n");
			}
			if (StyleFormatConstants.VERTICAL_ALIGN_BOTTOM.equals(style.get(StyleFormatConstants.VERTICAL_ALIGN_KEY))) {
				css.append("vertical-align:bottom; \n");
			}
		}
		if (style.containsKey(StyleFormatConstants.PADDING_LEFT)) {
			Float val = (Float) style.get(StyleFormatConstants.PADDING_LEFT);
			css.append("padding-left:").append(val).append("pt; \n");
		}
		if (style.containsKey(StyleFormatConstants.PADDING_RIGHT)) {
			Float val = (Float) style.get(StyleFormatConstants.PADDING_RIGHT);
			css.append("padding-right:").append(val).append("pt; \n");
		}
		if (style.containsKey(StyleFormatConstants.PADDING_TOP)) {
			Float val = (Float) style.get(StyleFormatConstants.PADDING_TOP);
			css.append("padding-top:").append(val).append("pt; \n");
		}
		if (style.containsKey(StyleFormatConstants.PADDING_BOTTOM)) {
			Float val = (Float) style.get(StyleFormatConstants.PADDING_BOTTOM);
			css.append("padding-bottom:").append(val).append("px; \n");
		}
		
		if (needed) {
			if (style.containsKey(StyleFormatConstants.BORDER_LEFT)) {
				Float val = (Float) style.get(StyleFormatConstants.BORDER_LEFT);
				css.append("border-left:").append(val.intValue()).append("px; \n");
				css.append("border-left-style:solid; \n");
				Color color = (Color) style.get(StyleFormatConstants.BORDER_LEFT_COLOR);
				css.append("border-left-color: ").append(Integer.toHexString(color.getRGB() & 0x00ffffff)).append(" ;\n");

			} else {
				css.append("border-left: none; \n");
			}
			if (style.containsKey(StyleFormatConstants.BORDER_RIGHT)) {
				Float val = (Float) style.get(StyleFormatConstants.BORDER_RIGHT);
				css.append("border-right:").append(val.intValue()).append("px; \n");
				css.append("border-right-style:solid; \n");
				Color color = (Color) style.get(StyleFormatConstants.BORDER_RIGHT_COLOR);
				css.append("border-right-color: ").append(Integer.toHexString(color.getRGB() & 0x00ffffff)).append(" ;\n");
			} else {
				css.append("border-right: none; \n");
			}
			if (style.containsKey(StyleFormatConstants.BORDER_TOP)) {
				Float val = (Float) style.get(StyleFormatConstants.BORDER_TOP);
				css.append("border-top:").append(val.intValue()).append("px; \n");
				css.append("border-top-style:solid; \n");
				Color color = (Color) style.get(StyleFormatConstants.BORDER_TOP_COLOR);
				css.append("border-top-color: ").append(Integer.toHexString(color.getRGB() & 0x00ffffff)).append(" ;\n");
			} else {
				css.append("border-top: none; \n");
			}
			if (style.containsKey(StyleFormatConstants.BORDER_BOTTOM)) {
				Float val = (Float) style.get(StyleFormatConstants.BORDER_BOTTOM);
				css.append("border-bottom:").append(val.intValue()).append("px; \n");
				css.append("border-bottom-style:solid; \n");
				Color color = (Color) style.get(StyleFormatConstants.BORDER_BOTTOM_COLOR);
				css.append("border-bottom-color: ").append(Integer.toHexString(color.getRGB() & 0x00ffffff)).append(" ;\n");
			} else {
				css.append("border-bottom: none; \n");
			}
		}
		if (be != null) {
			if (!be.isWrapText()) {
				css.append("white-space: nowrap; \n");
			} else {
				css.append("word-wrap: break-word; \n");
				css.append("line-height: " + be.getPercentLineSpacing() + "%; \n");
			}
			// if (be.getTextRotation() != 0) {
			// css.append(getRotationStyle(be.getTextRotation()));
			// }
		}

		return css.toString();

	}
753053
protected void setFontName(String fontName) {
        this.fontName = fontName;
        if(document != null) {
            this.fontNumber = document.getDocumentHeader().getFontNumber(this);
        }
    }
250842
@Nonnull
  public FontSpec getCloneWithDifferentFontSize (final float fNewFontSize)
  {
    ValueEnforcer.isGT0 (fNewFontSize, "FontSize");
    if (EqualsHelper.equals (fNewFontSize, m_fFontSize))
      return this;
    return new FontSpec (m_aPreloadFont, fNewFontSize, m_aColor);
  }
520633
@Override
  public String fixPropertyName(String name) {
    name = super.fixPropertyName(name);
    if ("cssFloat".equals(name)) {
      return "styleFloat";
    } else if ("class".equals(name)) {
      return "className";
    }
    return name;
  }
407835
function(node, name) {
                var value = this.getStyle(node.getType() + "-" + name, node);
                return value !== null ? value : this.getStyle(name, node);
            }
323840
public function getStyle($name) {
        if (!$this->hasStyle($name)) {
            throw new \InvalidArgumentException(sprintf('Undefined style: %s', $name));
        }

        return $this->styles[strtolower($name)];
    }