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

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

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

Font.setFontFamily介绍

暂无

代码示例

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

  1. public Font createFont(
  2. Expression fontFamily,
  3. Expression fontStyle,
  4. Expression fontWeight,
  5. Expression fontSize) {
  6. Font font = new FontImpl();
  7. if (fontFamily == null) {
  8. throw new IllegalArgumentException("Null font family specified");
  9. }
  10. font.setFontFamily(fontFamily);
  11. if (fontSize == null) {
  12. throw new IllegalArgumentException("Null font size specified");
  13. }
  14. font.setFontSize(fontSize);
  15. if (fontStyle == null) {
  16. throw new IllegalArgumentException("Null font Style specified");
  17. }
  18. font.setFontStyle(fontStyle);
  19. if (fontWeight == null) {
  20. throw new IllegalArgumentException("Null font weight specified");
  21. }
  22. font.setFontWeight(fontWeight);
  23. return font;
  24. }

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

  1. /**
  2. * Utility method to capture the default font in one place.
  3. *
  4. * @return
  5. */
  6. static Font createDefault(FilterFactory filterFactory) {
  7. Font font = new FontImpl();
  8. try {
  9. font.setSize(filterFactory.literal(Integer.valueOf(10)));
  10. font.setStyle(filterFactory.literal("normal"));
  11. font.setWeight(filterFactory.literal("normal"));
  12. font.setFontFamily(filterFactory.literal("Serif"));
  13. } catch (org.geotools.filter.IllegalFilterException ife) {
  14. throw new RuntimeException("Error creating default", ife);
  15. }
  16. return font;
  17. }

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

  1. @Override
  2. public void handle(YamlObject<?> obj, YamlParseContext context) {
  3. sym.setFont(font);
  4. YamlMap map = obj.map();
  5. if (map.has("font-family")) {
  6. font.setFontFamily(Util.expression(map.str("font-family"), factory));
  7. }
  8. if (map.has("font-size")) {
  9. font.setSize(Util.expression(map.str("font-size"), factory));
  10. }
  11. if (map.has("font-style")) {
  12. font.setStyle(Util.expression(map.str("font-style"), factory));
  13. }
  14. if (map.has("font-weight")) {
  15. font.setWeight(Util.expression(map.str("font-weight"), factory));
  16. }
  17. }
  18. }

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

  1. public Font createFont(Expression fontFamily, Expression fontStyle,
  2. Expression fontWeight, Expression fontSize) {
  3. Font font = new FontImpl();
  4. if (fontFamily == null) {
  5. throw new IllegalArgumentException("Null font family specified");
  6. }
  7. font.setFontFamily(fontFamily);
  8. if (fontSize == null) {
  9. throw new IllegalArgumentException("Null font size specified");
  10. }
  11. font.setFontSize(fontSize);
  12. if (fontStyle == null) {
  13. throw new IllegalArgumentException("Null font Style specified");
  14. }
  15. font.setFontStyle(fontStyle);
  16. if (fontWeight == null) {
  17. throw new IllegalArgumentException("Null font weight specified");
  18. }
  19. font.setFontWeight(fontWeight);
  20. return font;
  21. }

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

  1. public Font createFont(Expression fontFamily, Expression fontStyle,
  2. Expression fontWeight, Expression fontSize) {
  3. Font font = new FontImpl();
  4. if (fontFamily == null) {
  5. throw new IllegalArgumentException("Null font family specified");
  6. }
  7. font.setFontFamily(fontFamily);
  8. if (fontSize == null) {
  9. throw new IllegalArgumentException("Null font size specified");
  10. }
  11. font.setFontSize(fontSize);
  12. if (fontStyle == null) {
  13. throw new IllegalArgumentException("Null font Style specified");
  14. }
  15. font.setFontStyle(fontStyle);
  16. if (fontWeight == null) {
  17. throw new IllegalArgumentException("Null font weight specified");
  18. }
  19. font.setFontWeight(fontWeight);
  20. return font;
  21. }

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

  1. font.setFontFamily(parseCssParameter(child));

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

  1. font.setFontFamily(parseCssParameter(child));
  2. } else if (res.equalsIgnoreCase("font-style")) {
  3. font.setFontStyle(parseCssParameter(child));

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

  1. /**
  2. * Utility method to capture the default font in one place.
  3. * @return
  4. */
  5. static Font createDefault( FilterFactory filterFactory ) {
  6. Font font = new FontImpl();
  7. try {
  8. font.setSize(filterFactory.literal(
  9. new Integer(10)));
  10. font.setStyle(filterFactory.literal("normal"));
  11. font.setWeight(filterFactory.literal("normal"));
  12. font.setFontFamily(filterFactory.literal("Serif"));
  13. } catch (org.geotools.filter.IllegalFilterException ife) {
  14. throw new RuntimeException("Error creating default", ife);
  15. }
  16. return font;
  17. }

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

  1. /**
  2. * Creates a defaultFont which is valid on all machines. The font is of
  3. * size 10, Style and Weight normal and uses a serif font.
  4. *
  5. * @return the default Font
  6. *
  7. * @throws RuntimeException DOCUMENT ME!
  8. */
  9. public Font getDefaultFont() {
  10. Font font = new FontImpl();
  11. try {
  12. font.setFontSize(filterFactory.literal(
  13. new Integer(10)));
  14. font.setFontStyle(filterFactory.literal("normal"));
  15. font.setFontWeight(filterFactory.literal("normal"));
  16. font.setFontFamily(filterFactory.literal("Serif"));
  17. } catch (org.geotools.filter.IllegalFilterException ife) {
  18. throw new RuntimeException("Error creating font", ife);
  19. }
  20. return font;
  21. }

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

  1. public void apply(){
  2. if(font != null){
  3. font.setFontFamily(guiFamily.getExpression());
  4. font.setFontSize(guiSize.getExpression());
  5. font.setFontStyle(guiStyle.getExpression());
  6. font.setFontWeight(guiWeight.getExpression());
  7. }
  8. }

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

  1. @Override
  2. public void handle(YamlObject<?> obj, YamlParseContext context) {
  3. sym.setFont(font);
  4. YamlMap map = obj.map();
  5. if (map.has("font-family")) {
  6. font.setFontFamily(Util.expression(map.str("font-family"), factory));
  7. }
  8. if (map.has("font-size")) {
  9. font.setSize(Util.expression(map.str("font-size"), factory));
  10. }
  11. if (map.has("font-style")) {
  12. font.setStyle(Util.expression(map.str("font-style"), factory));
  13. }
  14. if (map.has("font-weight")) {
  15. font.setWeight(Util.expression(map.str("font-weight"), factory));
  16. }
  17. }
  18. }

相关文章