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

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

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

Font.getFontWeight介绍

暂无

代码示例

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

String reqWeight = evalToString(curr.getFontWeight(), feature, 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: org.geotools/gt-render

private java.awt.Font styleFont(Object feature, Font curr,
  java.awt.Font javaFont) {
  String reqStyle = evalToString(curr.getFontStyle(), feature, null);
  int styleCode;
  if (fontStyleLookup.containsKey(reqStyle)) {
    styleCode = ((Integer) fontStyleLookup.get(reqStyle)).intValue();
  } else {
    styleCode = java.awt.Font.PLAIN;
  }
  String reqWeight = evalToString(curr.getFontWeight(), feature, null);
  if ("Bold".equalsIgnoreCase(reqWeight)) {
    styleCode = styleCode | java.awt.Font.BOLD;
  }
  float size = evalToFloat(curr.getSize(), feature, 10);
  return javaFont.deriveFont(styleCode, size);
}

代码示例来源:origin: org.geotools/gt2-render

String reqWeight = (String) fonts[k].getFontWeight().evaluate(feature);
String reqWeight = (String) fonts[k].getFontWeight().evaluate(feature);

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

public void setEdited(Font font){        
  this.font = font;
  
  if(font != null){
    guiFamily.setExpression(font.getFontFamily());
    guiSize.setExpression(font.getFontSize());
    guiStyle.setExpression(font.getFontStyle());
    guiWeight.setExpression(font.getFontWeight());
  }
}

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

/** Null safe copy of a single font */
protected Font copy(Font font) {
  if( font == null) return font;
  
  Expression fontFamily = copy( font.getFontFamily() );
  Expression fontStyle = copy( font.getFontStyle() );
  Expression fontWeight = copy( font.getFontWeight() );
  Expression fontSize = copy( font.getFontSize() );
  Font copy = sf.createFont(fontFamily, fontStyle, fontWeight, fontSize);
  return copy;
}

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

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

代码示例来源:origin: org.geotools/gt2-main

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

代码示例来源:origin: org.geotools/gt2-main

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

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

encodeCssParam("font-weight", fonts[0].getFontWeight());
end("Font");

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

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

代码示例来源:origin: org.geotools/gt2-main

encodeCssParam("font-weight", fonts[0].getFontWeight());
end("Font");

相关文章