Examples of Font


Examples of org.eclipse.swt.graphics.Font

       
        FontData[] fontData = _toolbarLblProject.getFont().getFontData();
        for(int i = 0; i < fontData.length; ++i) {
            fontData[i].setStyle(SWT.BOLD);
        }
        final Font newFont = new Font(getSite().getShell().getDisplay(), fontData);
        _toolbarLblProject.setFont(newFont);
        _toolbarLblProject.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                newFont.dispose();
            }
        });
       
        _toolbarLblLocation = new Label(leftComp, SWT.NONE);
       
View Full Code Here

Examples of org.geotools.styling.Font

     * @param symbolizer Text symbolizer information.
     * @return FontData[] of the font's fill, or null if unavailable.
     */
    public static FontData[] textFont( TextSymbolizer symbolizer ) {

        Font font = font(symbolizer);
        if (font == null)
            return null;
        // FIXME: font style isn't being set properly here...seems screwy so leaving till later
        // String fontStyle = font[0].getFontStyle().toString();
        // if(fontStyle == null) return null;
        // else if(fontStyle.equalsIgnoreCase("italic"))

        FontData[] tempFD = new FontData[1];
        Expression fontFamilyExpression = font.getFamily().get(0);
        Expression sizeExpression = font.getSize();
        if (sizeExpression == null || fontFamilyExpression == null)
            return null;

        Double size = sizeExpression.evaluate(null, Double.class);

View Full Code Here

Examples of org.joshy.gfx.draw.Font


    @Override
    public void draw(GFX gfx) {
        if(this.string != null) {
            Font font = Font.name("OpenSans").size(26).resolve();
            double width = font.calculateWidth(string) + 30;
            if(width < getWidth()) {
                width = getWidth();
            }
            gfx.setPaint(FlatColor.hsb(0, 0, 0.8, this.getOpacity() * 0.9));
            gfx.fillRoundRect(0, 0, width, getHeight(), 10, 10);
View Full Code Here

Examples of org.newdawn.slick.Font

      throws SlickException {
    if (!visible)
      return;
    super.render(container, g);
    g.setColor(Color.black);
    Font oldFont = g.getFont();
    g.setFont(font);
    int startx = (int) x + 5;
    int starty = (int) y + 5;
    for (String line : messageLines) {
      g.drawString(line, startx, starty);
View Full Code Here

Examples of org.odftoolkit.simple.style.Font

      SpreadsheetDocument document;
      document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table1 = document.getTableByName("Sheet1");
      Cell cell1 = table1.getCellByPosition("A1");
      cell1.setStringValue("abcdefg");
      Font font1 = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 12, Color.BLACK,
          StyleTypeDefinitions.TextLinePosition.THROUGH);
      cell1.setFont(font1);
      Font font11 = cell1.getFont();
      System.out.println(font11);
      if (!font11.equals(font1))
        Assert.fail();

      Cell cell2 = table1.getCellByPosition("A2");
      cell2.setStringValue("redstring");
      Font font2 = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 12, Color.RED,
          StyleTypeDefinitions.TextLinePosition.UNDER);
      cell2.setFont(font2);
      Font font22 = cell2.getFont();
      System.out.println(font22);
      if (!font22.equals(font2))
        Assert.fail();
      document.save(ResourceUtilities.newTestOutputFile("TestSetGetFont.ods"));
    } catch (Exception e) {
      Logger.getLogger(TableCellTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
      Assert.fail();
View Full Code Here

Examples of org.openqa.jetty.html.Font

            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Other HTTP Headers")
                .attribute("COLSPAN", "2")
                .left();
            Enumeration h= request.getHeaderNames();
            String name;
            while (h.hasMoreElements())
            {
                name= (String)h.nextElement();

                Enumeration h2= request.getHeaders(name);
                while (h2.hasMoreElements())
                {
                    String hv= (String)h2.nextElement();
                    table.newRow();
                    table.addHeading(name + ":&nbsp;").cell().right();
                    table.addCell(hv);
                }
            }

            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Request Parameters")
                .attribute("COLSPAN", "2")
                .left();
            h= request.getParameterNames();
            while (h.hasMoreElements())
            {
                name= (String)h.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().right();
                table.addCell(request.getParameter(name));
                String[] values= request.getParameterValues(name);
                if (values == null)
                {
                    table.newRow();
                    table.addHeading(name + " Values:&nbsp;").cell().right();
                    table.addCell("NULL!!!!!!!!!");
                }
                else
                    if (values.length > 1)
                    {
                        for (int i= 0; i < values.length; i++)
                        {
                            table.newRow();
                            table.addHeading(name + "[" + i + "]:&nbsp;").cell().right();
                            table.addCell(values[i]);
                        }
                    }
            }

            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Cookies")
                .attribute("COLSPAN", "2")
                .left();
            Cookie[] cookies = request.getCookies();
            for (int i=0; cookies!=null && i<cookies.length;i++)
            {
                Cookie cookie = cookies[i];

                table.newRow();
                table.addHeading(cookie.getName() + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell(cookie.getValue());
            }
           
            /* ------------------------------------------------------------ */
            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Request Attributes")
                .attribute("COLSPAN", "2")
                .left();
            Enumeration a= request.getAttributeNames();
            while (a.hasMoreElements())
            {
                name= (String)a.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell("<pre>" + toString(request.getAttribute(name)) + "</pre>");
            }           

            /* ------------------------------------------------------------ */
            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Servlet InitParameters")
                .attribute("COLSPAN", "2")
                .left();
            a= getInitParameterNames();
            while (a.hasMoreElements())
            {
                name= (String)a.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell("<pre>" + toString(getInitParameter(name)) + "</pre>");
            }

            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Context InitParameters")
                .attribute("COLSPAN", "2")
                .left();
            a= getServletContext().getInitParameterNames();
            while (a.hasMoreElements())
            {
                name= (String)a.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell("<pre>" + toString(getServletContext().getInitParameter(name)) + "</pre>");
            }

            table.newRow();
            table
                .newHeading()
                .cell()
                .nest(new Font(2, true))
                .add("<BR>Context Attributes")
                .attribute("COLSPAN", "2")
                .left();
            a= getServletContext().getAttributeNames();
            while (a.hasMoreElements())
            {
                name= (String)a.nextElement();
                table.newRow();
                table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                table.addCell("<pre>" + toString(getServletContext().getAttribute(name)) + "</pre>");
            }

            if (request.getContentType() != null
                && request.getContentType().startsWith("multipart/form-data")
                && request.getContentLength() < 1000000)
            {
                MultiPartRequest multi= new MultiPartRequest(request);
                String[] parts= multi.getPartNames();

                table.newRow();
                table
                    .newHeading()
                    .cell()
                    .nest(new Font(2, true))
                    .add("<BR>Multi-part content")
                    .attribute("COLSPAN", "2")
                    .left();
                for (int p= 0; p < parts.length; p++)
                {
                    name= parts[p];
                    table.newRow();
                    table.addHeading(name + ":&nbsp;").cell().attribute("VALIGN", "TOP").right();
                    table.addCell("<pre>" + multi.getString(parts[p]) + "</pre>");
                }
            }

            String res= request.getParameter("resource");
            if (res != null && res.length() > 0)
            {
                table.newRow();
                table
                    .newHeading()
                    .cell()
                    .nest(new Font(2, true))
                    .add("<BR>Get Resource: " + res)
                    .attribute("COLSPAN", "2")
                    .left();

                table.newRow();
View Full Code Here

Examples of org.pdfclown.documents.contents.fonts.Font

    if(currentRow == null
      || text == null)
      return 0;

    ContentScanner.GraphicsState state = baseComposer.getState();
    Font font = state.getFont();
    float fontSize = state.getFontSize();
    float lineHeight = font.getLineHeight(fontSize);

    TextFitter textFitter = new TextFitter(
      text,
      0,
      font,
View Full Code Here

Examples of org.pentaho.metadata.model.concept.types.Font

    if (type == null || Font.class.equals(type))
    {
      return value;
    }

    final Font fontSettings = (Font) value;
    final String valueAsString = String.valueOf(fontSettings.getHeight());
    if (String.class.isAssignableFrom(type))
    {
      return valueAsString;
    }
    try
View Full Code Here

Examples of org.terasology.rendering.assets.font.Font

    }

    @Override
    public Vector2i getPreferredSize(T value, Canvas canvas) {
        Font font = canvas.getCurrentStyle().getFont();
        List<String> lines = TextLineBuilder.getLines(font, getString(value), canvas.size().x);
        return font.getSize(lines);
    }
View Full Code Here

Examples of org.toyz.litetext.Font

     *
     * @return Font The Font object
     */
    static public Font loadfont(String fontname) {
   
    Font font = new Font();
    Properties fontprops = new Properties();
//    FileInputStream in;
        InputStream in;
        in = FontUtils.class.getResourceAsStream("/fonts/" + fontname + "/font.txt");
        if (in == null) {
          return null;
        }
    try {
      fontprops.load(in);
            in.close();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return null;
    }
    finally {
      try {
        in.close();
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
      font.setMaxwidth(Integer.parseInt(fontprops.getProperty("maxwidth")));
      font.setMaxheight(Integer.parseInt(fontprops.getProperty("maxheight")));
      font.setX(Integer.parseInt(fontprops.getProperty("x")));
      font.setY(Integer.parseInt(fontprops.getProperty("y")));
      font.setOldfont(Integer.parseInt(fontprops.getProperty("oldfont")));
      font.setFcols(Integer.parseInt(fontprops.getProperty("fcols")));
      font.setFrows(Integer.parseInt(fontprops.getProperty("frows")));
      for (int i = 0; i < 256; i++) {
            in = FontUtils.class.getResourceAsStream("/fonts/" + fontname + "/glyph." + i);
            if (in == null) {
              font.addGlyph(null);
        continue;
            }
      Properties gprops = new Properties();
      try {
        gprops.load(in);
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        try {
          in.close();
        } catch (IOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
        continue;
      }
      Glyph g = new Glyph();
      g.setWidth(Integer.parseInt(gprops.getProperty("width")));
      g.setHeight(Integer.parseInt(gprops.getProperty("height")));
      g.setX(Integer.parseInt(gprops.getProperty("x")));
      g.setY(Integer.parseInt(gprops.getProperty("y")));
      g.setXadd(Integer.parseInt(gprops.getProperty("xadd")));

      try {
        in.close();
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      try {
                InputStream is = FontUtils.class.getResourceAsStream("/fonts/" + fontname + "/glyph_bmap." + i);
                g.setBmap(getBytesFromInputStream(is, g.getWidth() * g.getHeight()));
//        g.setBmap(getBytesFromFile(new File("fonts/" + fontname + "/glyph_bmap." + i)));
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        return null;
      }
      font.addGlyph(g);

      }
    return font;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.