CSize iDrawContext.measureText(string text, float width, iFont fontInterface) { Matrix3x2 curr = transform.current; float pixel = computePixelSize(ref curr); int widthPIxels = (int)MathF.Round(width / pixel); Matrix3x2 tform = transform.current; eTextRendering renderMode = textRenderingStyle(tform.snapMatrixToInt()); var font = (Font)fontInterface; return(font.measureText(text, widthPIxels, renderMode)); }
void iDrawContext.drawText(string text, iFont font, Rect layoutRect, iBrush foreground, iBrush background) { drawText(text, (Font)font, ref layoutRect, foreground.data(), background.data()); }
CSize Draw.iDrawContext.measureText(string text, float width, iFont font) => throw new NotImplementedException();
void Draw.iDrawContext.drawText(string text, iFont font, Rect layoutRect, Draw.iBrush foreground, Draw.iBrush background) => throw new NotImplementedException();
public void create(double dpi) { font = face.createFont(sizePointe, (float)dpi); }
public sFont(iFontFace face, float size) { this.face = face; sizePointe = size; font = null; }