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

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

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

Font.getStyle介绍

[英]The "font-style" SVG parameter should be "normal", "italic", or "oblique".

If null is returned the default value should be considered "normal".
[中]“字体样式”SVG参数应为“正常”、“斜体”或“倾斜”。
如果返回null,则默认值应视为“正常”。

代码示例

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

public FontBuilder reset() {
  Font df = sf.getDefaultFont();
  this.families = new ArrayList<Expression>();
  this.size = df.getSize();
  this.style = df.getStyle();
  this.weight = df.getWeight();
  return this;
}

代码示例来源: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

Expression referenceStyle = reference.getStyle();
Expression referenceWeight = reference.getWeight();
for (int i = 1; i < fonts.size(); i++) {
    return false;
  Expression style = f.getStyle();
  if (!expressionEquals(referenceStyle, style, DEFAULT_FONT.getStyle())) {
    return false;

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

String styleName = ((Literal) selectedFont.getStyle()).getValue().toString();
for (int index = 0; index < styles.length; index++) {
  if (styles[index].equalsIgnoreCase(styleName)) {

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

@Override
  protected void encode(Font font) {
    putName("font-family", font.getFontFamily());
    put("font-size", font.getSize());
    putName("font-style", font.getStyle());
    putName("font-weight", font.getWeight());
  }
}

代码示例来源: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 style set.
 *
 * @return true, if is font name set
 */
public boolean isFontStyleSet() {
  return ((font != null) && (font.getStyle() != null));
}

代码示例来源: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: geotools/geotools

font.getSize().accept(this, null);
if (font.getStyle() != null) {
  font.getStyle().accept(this, null);

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

/**
 * Gets the font style.
 *
 * @return the fontStyle
 */
public String getFontStyle() {
  if (isFontStyleSet()) {
    return this.font.getStyle().toString();
  }
  return NOT_SET_STRING;
}

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

/**
 * Checks if is font style updated.
 *
 * @return the fontStyleUpdated
 */
public boolean isFontStyleUpdated() {
  return (font != null) && isSame(originalFontStyle, font.getStyle());
}

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

encodeCssParam("font-style", initialFont.getStyle());
encodeCssParam("font-weight", initialFont.getWeight());
end("Font");
  encodeCssParam("font-family", font.getFamily().get(0));
  encodeCssParam("font-size", font.getSize());
  encodeCssParam("font-style", font.getStyle());
  encodeCssParam("font-weight", font.getWeight());
  end("Font");

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

if (font.getStyle() != null) {
  font.getStyle().accept(this, null);

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

assertEquals("Arial", Filters.asString(font.getFontFamily()));
assertEquals(10, Filters.asInt(font.getSize()));
assertEquals("normal", Filters.asString(font.getStyle()));
assertEquals("bold", Filters.asString(font.getWeight()));

代码示例来源: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: geotools/geotools

assertEquals(12, Filters.asInt(font.getSize()));
assertEquals("bold", Filters.asString(font.getWeight()));
assertEquals("normal", Filters.asString(font.getStyle()));

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

assertEquals("Arial", Filters.asString(font.getFontFamily()));
assertEquals(11, Filters.asInt(font.getSize()));
assertEquals("normal", Filters.asString(font.getStyle()));
assertEquals("bold", Filters.asString(font.getWeight()));

代码示例来源:origin: org.geotools/gt-ysld

@Override
  protected void encode(Font font) {
    putName("font-family", font.getFontFamily());
    put("font-size", font.getSize());
    putName("font-style", font.getStyle());
    putName("font-weight", font.getWeight());
  }
}

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

assertEquals(12, Filters.asInt(font.getSize()));
assertEquals("bold", Filters.asString(font.getWeight()));
assertEquals("normal", Filters.asString(font.getStyle()));

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

/** @param textSymbolizer */
private void populateFont(TextSymbolizer textSymbolizer) {
  Font font = textSymbolizer.getFont();
  GroupConfigInterface group = getGroup(GroupIdEnum.FONT);
  group.enable(font != null);
  if (font != null) {
    fieldConfigVisitor.populateFontField(FieldIdEnum.FONT_FAMILY, font);
    fieldConfigVisitor.populateField(FieldIdEnum.FONT_WEIGHT, font.getWeight());
    fieldConfigVisitor.populateField(FieldIdEnum.FONT_STYLE, font.getStyle());
    fieldConfigVisitor.populateField(FieldIdEnum.FONT_SIZE, font.getSize());
  }
  fieldConfigVisitor.populateFontField(FieldIdEnum.FONT_PREVIEW, font);
}

相关文章