org.geotools.styling.Font.getFamily()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.geotools.styling.Font.getFamily()方法的一些代码示例,展示了Font.getFamily()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Font.getFamily()方法的具体详情如下:
包路径:org.geotools.styling.Font
类名称:Font
方法名:getFamily

Font.getFamily介绍

[英]SVG font-family parameters in preferred order.
[中]SVG字体系列参数的首选顺序。

代码示例

代码示例来源:origin: geotools/geotools

public FontBuilder reset(Font font) {
  if (font == null) {
    return reset();
  }
  this.families = font.getFamily() != null ? font.getFamily() : new ArrayList<Expression>();
  this.size = font.getSize();
  this.style = font.getStyle();
  this.weight = font.getWeight();
  unset = false;
  return this;
}

代码示例来源:origin: geotools/geotools

if (firstFontFamily) {
    font.getFamily().clear();
    firstFontFamily = false;
  font.getFamily().add(parseCssParameter(child));
} else if (res.equalsIgnoreCase("font-style")) {
  font.setFontStyle(parseCssParameter(child));

代码示例来源:origin: geotools/geotools

for (Expression family : curr.getFamily()) {
  String requestedFont = evalToString(family, feature, null);
  java.awt.Font javaFont = FontCache.getDefaultInstance().getFont(requestedFont);

代码示例来源:origin: geotools/geotools

font.getFamily().set(0, exp);
  familyFound = true;
} else {
  font.getFamily().add(exp);

代码示例来源:origin: geotools/geotools

for (Expression family : selectedFont.getFamily()) {
  String familyName = ((Literal) family).getValue().toString();
  for (int index = 0; index < families.length; index++) {

代码示例来源:origin: geotools/geotools

/** Null safe copy of a single font */
protected Font copy(Font font) {
  if (font == null) return font;
  List<Expression> fontFamily = copyExpressions(font.getFamily());
  Expression fontStyle = copy(font.getStyle());
  Expression fontWeight = copy(font.getWeight());
  Expression fontSize = copy(font.getSize());
  Font copy = sf.font(fontFamily, fontStyle, fontWeight, fontSize);
  return copy;
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Checks if font name set.
 *
 * @return true, if is font name set
 */
public boolean isFontNameSet() {
  return ((font != null) && !font.getFamily().isEmpty());
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Checks if is font name updated.
 *
 * @return the fontNameUpdated
 */
public boolean isFontNameUpdated() {
  return ((font != null) && !(originalFontName.equals(font.getFamily())));
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Gets the string value.
 *
 * @return the string value
 */
@Override
public String getStringValue() {
  Font font = getFont();
  if ((font != null) && (!font.getFamily().isEmpty())) {
    return font.getFamily().get(0).toString();
  }
  return null;
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Gets the font name.
 *
 * @return the fontName
 */
public String getFontName() {
  if (isFontNameSet()) {
    return this.font.getFamily().get(0).toString();
  }
  return NOT_SET_STRING;
}

代码示例来源:origin: geotools/geotools

List<Font> fonts = text.fonts();
for (Font font : fonts) {
  if (font.getFamily() != null) {
    for (Expression family : font.getFamily()) {
      family.accept(this, null);

代码示例来源:origin: geotools/geotools

encodeCssParam("font-family", font.getFamily().get(0));
encodeCssParam("font-family", font.getFamily().get(0));
encodeCssParam("font-size", font.getSize());
encodeCssParam("font-style", font.getStyle());

代码示例来源:origin: geotools/geotools

@SuppressWarnings("deprecation")
@Test
public void font() throws Exception {
  List<Expression> family = new ArrayList<Expression>();
  family.add(ff.literal("ariel"));
  family.add(ff.literal("Helvetica"));
  family.add(ff.literal("sanserif"));
  Expression style = ff.literal("noraml");
  Expression weight = ff.literal("normal");
  Expression size = ff.literal(12);
  Font font = sf.font(family, style, weight, size);
  assertEquals(family, font.getFamily());
  assertEquals(style, font.getStyle()); // oblique or italic
  assertEquals(weight, font.getWeight()); // bold or normal
  assertEquals(size, font.getSize());
  assertSame(font.getFontStyle(), font.getStyle());
  assertSame(font.getFontFamily(), family.get(0));
  assertSame(font.getFontWeight(), font.getWeight());
  assertSame(font.getFontSize(), font.getSize());
  FontImpl cast = FontImpl.cast(font);
  assertSame(cast, font);
}

代码示例来源:origin: robward-scisys/sldeditor

/** Revert to original. */
public void revertToOriginal() {
  if (this.font != null) {
    this.font.getFamily().clear();
    this.font.getFamily().addAll(originalFontName);
    this.font.setWeight(originalFontWeight);
    this.font.setStyle(originalFontStyle);
    this.font.setSize(originalFontSize);
  }
}

代码示例来源:origin: geotools/geotools

if (font.getFamily() != null) {
  for (Expression list : font.getFamily()) {
    list.accept(this, null);

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Sets the font.
 *
 * @param newFont the new font
 */
public void setFont(Font newFont) {
  if (newFont != null) {
    this.font = styleFactory.getDefaultFont();
    font.getFamily().clear();
    font.getFamily().addAll(newFont.getFamily());
    font.setStyle(newFont.getStyle());
    font.setWeight(newFont.getWeight());
    font.setSize(newFont.getSize());
    setOriginalData(newFont);
  }
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Sets the original data.
 *
 * @param newFont the new original data
 */
private void setOriginalData(Font newFont) {
  this.originalFontName = newFont.getFamily();
  this.originalFontStyle = newFont.getStyle();
  this.originalFontWeight = newFont.getWeight();
  this.originalFontSize = newFont.getSize();
}

代码示例来源:origin: robward-scisys/sldeditor

/**
   * Gets the font.
   *
   * @return the font
   */
  public Font getFont() {

    List<Expression> family = new ArrayList<>();
    Expression style = null;
    Expression weight = null;
    Expression size = null;

    if (firstEntry != null) {
      family = (familyMultipleValue ? firstEntry.getFamily() : family);
      style = (styleMultipleValue ? firstEntry.getStyle() : null);
      weight = (weightMultipleValue ? firstEntry.getWeight() : null);
      size = (sizeMultipleValue ? firstEntry.getSize() : null);
    }

    return styleFactory.font(family, style, weight, size);
  }
}

代码示例来源:origin: geotools/geotools

assertEquals("Arial", Filters.asString(font.getFamily().get(0)));
assertEquals(12, Filters.asInt(font.getSize()));
assertEquals("bold", Filters.asString(font.getWeight()));

代码示例来源:origin: geotools/geotools

assertEquals("Arial", Filters.asString(font.getFamily().get(0)));
assertEquals(12, Filters.asInt(font.getSize()));
assertEquals("bold", Filters.asString(font.getWeight()));

相关文章