List of usage examples for com.google.gwt.canvas.dom.client Context2d strokeText
public final native void strokeText(String text, double x, double y) ;
From source file:org.oscim.gdx.client.GwtCanvas.java
License:Open Source License
@Override public void drawText(String string, float x, float y, Paint fill, Paint stroke) { if (bitmap == null) { //log.debug("no bitmap set"); return;// www . j ava 2 s . c om } GwtPaint p = (GwtPaint) fill; if (p.stroke && GwtGdxGraphics.NO_STROKE_TEXT) return; Context2d ctx = bitmap.pixmap.getContext(); ctx.setFont(p.font); if (p.stroke) { ctx.setLineWidth(p.strokeWidth); ctx.setStrokeStyle(p.color); ctx.strokeText(string, (int) (x + 1), (int) (y + 1)); } else { ctx.setFillStyle(p.color); ctx.fillText(string, (int) (x + 1), (int) (y + 1)); } }
From source file:playn.html.HtmlTextLayout.java
License:Apache License
void stroke(Context2d ctx, float x, float y) { configContext(ctx);/*w ww .j av a 2s. c o m*/ float ypos = 0; for (Line line : lines) { ctx.strokeText(line.text, x + format.align.getX(line.width, width), y + ypos); ypos += metrics.height; } }
From source file:playn.html.OldHtmlTextLayout.java
License:Apache License
public void stroke(Context2d ctx, float x, float y) { configContext(ctx);/* ww w . jav a2 s . co m*/ float ypos = 0; for (Line line : lines) { ctx.strokeText(line.text, x + format.align.getX(line.width, width), y + ypos); ypos += metrics.height; } }