Package org.timepedia.chronoscope.client.canvas

Examples of org.timepedia.chronoscope.client.canvas.RenderedFontMetrics


    double angle = getDouble(req, "a", 0.0);
    Color color = getColor(req.getParameter("c"));

    if (json != null) {

      RenderedFontMetrics rfm = getRenderedFontMetrics(req, font,
          "" + fontWeight, "" + fontSize + "pt", req.getParameter("c"),
          (float) angle);
      res.setContentType("text/javascript");
      ServletOutputStream out = res.getOutputStream();
      writeJSON(out, rfm, json);
View Full Code Here


    g2d.setFont(f);
    FontMetrics fm = g2d.getFontMetrics();
    Rectangle2D cb = getMaxCharBounds(g2d);
    cb = getMaxCharBounds(g2d);

    RenderedFontMetrics rfm = new RenderedFontMetrics();
    rfm.maxAdvance = fm.getMaxAdvance();
    rfm.maxAscent = fm.getMaxAscent();
    rfm.maxDescent = fm.getMaxDescent();
    rfm.leading = fm.getLeading();
    rfm.advances = fm.getWidths();
View Full Code Here

  }

  private void renderFontBook(HttpServletRequest req, String font,
      int fontWeight, int fontSize, double angle, Color color,
      ServletOutputStream out) throws IOException {
    RenderedFontMetrics rfm = getRenderedFontMetrics(req, font,
        fontWeight == Font.PLAIN ? "normal" : "bold", fontSize + "pt",
        toHex(color), (float) angle);

    int width = rfm.maxBoundsWidth * 16;
    int lineHeight = rfm.maxBoundsHeight;
View Full Code Here

  private static native String escape(String color) /*-{
    return $wnd.escape(color);
  }-*/;

  private void handle(JavaScriptObject jso, AsyncCallback async) {
    RenderedFontMetrics rfm = new RenderedFontMetrics();
    rfm.leading = (int) JavascriptHelper.jsPropGetD(jso, "leading");
    rfm.maxAdvance = (int) JavascriptHelper.jsPropGetD(jso, "maxAdvance");
    rfm.maxAscent = (int) JavascriptHelper.jsPropGetD(jso, "maxAscent");
    rfm.maxDescent = (int) JavascriptHelper.jsPropGetD(jso, "maxDescent");
    rfm.url = JavascriptHelper.jsPropGetString(jso, "url");
View Full Code Here

TOP

Related Classes of org.timepedia.chronoscope.client.canvas.RenderedFontMetrics

Copyright © 2018 www.massapicom. 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.