public final String getFontFamily() { String family = getString(Attribute.FONT_FAMILY.getProperty()); if ((null == family) || (family = family.trim()).isEmpty()) { family = LienzoCore.get().getDefaultFontFamily(); } return family; }
public final String getFontFamily() { String family = getString(Attribute.FONT_FAMILY.getProperty()); if ((null == family) || (family = family.trim()).isEmpty()) { family = LienzoCore.get().getDefaultFontFamily(); } return family; }
public final String getFontFamily() { String family = getString(Attribute.FONT_FAMILY.getProperty()); if ((null == family) || (family = family.trim()).isEmpty()) { family = LienzoCore.get().getDefaultFontFamily(); } return family; }
public final String getFontFamily() { String family = getString(Attribute.FONT_FAMILY.getProperty()); if ((null == family) || (family = family.trim()).isEmpty()) { family = LienzoCore.get().getDefaultFontFamily(); } return family; }
public final String getFontFamily() { String family = getString(Attribute.FONT_FAMILY.getProperty()); if ((null == family) || (family = family.trim()).isEmpty()) { family = LienzoCore.get().getDefaultFontFamily(); } return family; }
public final String getFontFamily() { String family = getString(Attribute.FONT_FAMILY.getProperty()); if ((null == family) || (family = family.trim()).isEmpty()) { family = LienzoCore.get().getDefaultFontFamily(); } return family; }
public final void setFontFamily(String family) { if ((null == family) || (family = family.trim()).isEmpty()) { put(Attribute.FONT_FAMILY.getProperty(), LienzoCore.get().getDefaultFontFamily()); } else { put(Attribute.FONT_FAMILY.getProperty(), family); } }
public final void setFontFamily(String family) { if ((null == family) || (family = family.trim()).isEmpty()) { put(Attribute.FONT_FAMILY.getProperty(), LienzoCore.get().getDefaultFontFamily()); } else { put(Attribute.FONT_FAMILY.getProperty(), family); } }
public final void setFontFamily(String family) { if ((null == family) || (family = family.trim()).isEmpty()) { put(Attribute.FONT_FAMILY.getProperty(), LienzoCore.get().getDefaultFontFamily()); } else { put(Attribute.FONT_FAMILY.getProperty(), family); } }
public final void setFontFamily(String family) { if ((null == family) || (family = family.trim()).isEmpty()) { put(Attribute.FONT_FAMILY.getProperty(), LienzoCore.get().getDefaultFontFamily()); } else { put(Attribute.FONT_FAMILY.getProperty(), family); } }
public final void setFontFamily(String family) { if ((null == family) || (family = family.trim()).isEmpty()) { put(Attribute.FONT_FAMILY.getProperty(), LienzoCore.get().getDefaultFontFamily()); } else { put(Attribute.FONT_FAMILY.getProperty(), family); } }
public final void setFontFamily(String family) { if ((null == family) || (family = family.trim()).isEmpty()) { put(Attribute.FONT_FAMILY.getProperty(), LienzoCore.get().getDefaultFontFamily()); } else { put(Attribute.FONT_FAMILY.getProperty(), family); } }
/** * Constructor. Creates an instance of text. Default no-wrap text wrapping. * * @param text * @param family font family * @param style font style (bold, italic, etc) * @param size font size */ public Text(String text, String family, String style, double size) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } if ((null == family) || ((family = family.trim()).isEmpty())) { family = globals.getDefaultFontFamily(); } if ((null == style) || ((style = style.trim()).isEmpty())) { style = globals.getDefaultFontStyle(); } if (size <= 0) { size = globals.getDefaultFontSize(); } setText(text).setFontFamily(family).setFontStyle(style).setFontSize(size); }
/** * Constructor. Creates an instance of text. Default no-wrap text wrapping. * * @param text * @param family font family * @param size font size */ public Text(String text, String family, double size) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } if ((null == family) || ((family = family.trim()).isEmpty())) { family = globals.getDefaultFontFamily(); } if (size <= 0) { size = globals.getDefaultFontSize(); } setText(text).setFontFamily(family).setFontStyle(globals.getDefaultFontStyle()).setFontSize(size); }
/** * Constructor. Creates an instance of text. * * @param text * @param family font family * @param points font size */ public Text(String text, String family, double size) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } if ((null == family) || ((family = family.trim()).isEmpty())) { family = globals.getDefaultFontFamily(); } if (size <= 0) { size = globals.getDefaultFontSize(); } setText(text).setFontFamily(family).setFontStyle(globals.getDefaultFontStyle()).setFontSize(size); }
/** * Constructor. Creates an instance of text. Default no-wrap text wrapping. * * @param text */ public Text(String text) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize()); }
/** * Constructor. Creates an instance of text. * * @param text */ public Text(String text) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize()); }
/** * Constructor. Creates an instance of text. Default no-wrap text wrapping. * * @param text */ public Text(String text) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize()); }
/** * Constructor. Creates an instance of text. Default no-wrap text wrapping. * * @param text */ public Text(String text) { super(ShapeType.TEXT); final LienzoCore globals = LienzoCore.get(); if (null == text) { text = ""; } setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize()); }
private final String getTextBestFit(Context2D context, String text, int wide) { double pt = LienzoCore.get().getDefaultFontSize(); String st = LienzoCore.get().getDefaultFontStyle(); String fm = LienzoCore.get().getDefaultFontFamily(); String tf = st + " " + pt + "pt " + fm; context.save(); context.setToIdentityTransform(); while (true) { context.setTextFont(tf); TextMetrics tm = context.measureText(text); if (tm.getWidth() < wide) { break; } pt = pt - 2; if (pt < 6) { break; } tf = st + " " + pt + "pt " + fm; } context.restore(); return tf; }