// DrawText draws text with a given style.
763199
func (d draw) Text(r Renderer, text string, x, y int, style Style) {
	style.GetTextOptions().WriteToRenderer(r)
	defer r.ResetStyle()

	r.Text(text, x, y)
}
1092151
func (gp *GoPdf) Text(text string) error {

	err := gp.curr.Font_ISubset.AddChars(text)
	if err != nil {
		return err
	}

	err = gp.getContent().AppendStreamText(text)
	if err != nil {
		return err
	}

	return nil
}
632098
func (i *ASCIIArt) Draw() {
	drawX, drawY := i.x, i.y
	for _, line := range i.contents {
		DrawStringAtPoint(line, drawX, drawY, i.fg, i.bg)
		drawY++
	}
}
1082164
func Text(text string, m ...MarkupOrChild) *HTML {
	h := &HTML{
		text: text,
	}
	for _, m := range m {
		apply(m, h)
	}
	return h
}
63207
func (r Root) Text() string {
	k := r.Pointer.FirstChild
checkNode:
	if k != nil && k.Type != html.TextNode {
		k = k.NextSibling
		if k == nil {
			if debug {
				panic("No text node found")
			}
			return ""
		}
		goto checkNode
	}
	if k != nil {
		r, _ := regexp.Compile(`^\s+$`)
		if ok := r.MatchString(k.Data); ok {
			k = k.NextSibling
			if k == nil {
				if debug {
					panic("No text node found")
				}
				return ""
			}
			goto checkNode
		}
		return k.Data
	}
	return ""
}
699726
func (s *SSMLMessageType) SetText(v string) *SSMLMessageType {
	s.Text = &v
	return s
}
829383
func DrawList(r *Box, items []string, selected int) {
	for i, s := range items {
		color := LISTTEXT
		if i == selected {
			color = LISTFOCUS
		}
		Write(r.frame.X, r.frame.Y+i, s, color, BOXBG)
	}
}
436472
func (a *DispatchKeyEventArgs) SetText(text string) *DispatchKeyEventArgs {
	a.Text = &text
	return a
}
551768
func (s *SynthesizeSpeechInput) SetText(v string) *SynthesizeSpeechInput {
	s.Text = &v
	return s
}
1080529
func (g *Graph) Text() string {
	if g == nil {
		return ""
	}

	buffer := &bytes.Buffer{}

	// Do not print the 'root' node
	for _, node := range g.Out {
		node._text(0, buffer, false)
	}

	// remove trailing \n

	s := buffer.String()

	if len(s) == 0 {
		return ""
	}

	if s[len(s)-1] == '\n' {
		s = s[0 : len(s)-1]
	}

	// unquote

	if s[0] == '"' {
		s = s[1 : len(s)-1]
		// But then also replace \"
		s = strings.Replace(s, "\\\"", "\"", -1)
	}

	return s
}
170161
func (c *ChatMeMessageCall) Text(text string) *ChatMeMessageCall {
	c.text = text
	return c
}
115866
func (s *CreateCommentInput) SetText(v string) *CreateCommentInput {
	s.Text = &v
	return s
}
532044
func (ctx *context) Text(text string) (int, error) {
	ctx.ContentType(ContentTextHeaderValue)
	return ctx.writer.WriteString(text)
}
785052
func (e *TextEdit) Draw(p *Painter) {
	style := "entry"
	if e.IsFocused() {
		style += ".focused"
	}
	p.WithStyle(style, func(p *Painter) {
		s := e.Size()
		e.text.SetMaxWidth(s.X)

		lines := e.text.SplitByLine()
		for i, line := range lines {
			p.FillRect(0, i, s.X, 1)
			p.DrawText(0, i, line)
		}
		if e.IsFocused() {
			pos := e.text.CursorPos()
			p.DrawCursor(pos.X, pos.Y)
		}
	})
}
1196961
func (vr *vectorRenderer) Text(body string, x, y int) {
	vr.c.Text(x, y, body, vr.s.GetTextOptions())
}
854672
func (g *drawer) Draw(s string, size int, bg *color.RGBA) image.Image {
	// draw the background
	dst := image.NewRGBA(image.Rect(0, 0, size, size))
	draw.Draw(dst, dst.Bounds(), &image.Uniform{bg}, image.ZP, draw.Src)

	// draw the text
	drawer := &font.Drawer{
		Dst:  dst,
		Src:  image.White,
		Face: g.face,
	}

	// font index
	fi := g.font.Index([]rune(s)[0])

	// glyph example: http://www.freetype.org/freetype2/docs/tutorial/metrics.png
	var gbuf truetype.GlyphBuf
	var err error
	fsize := fixed.Int26_6(g.fontSize * g.dpi * (64.0 / 72.0))
	err = gbuf.Load(g.font, fsize, fi, font.HintingFull)
	if err != nil {
		// fixme
		drawer.DrawString("")
		return dst
	}

	// center
	dY := int((size - int(gbuf.Bounds.Max.Y-gbuf.Bounds.Min.Y)>>6) / 2)
	dX := int((size - int(gbuf.Bounds.Max.X-gbuf.Bounds.Min.X)>>6) / 2)
	y := int(gbuf.Bounds.Max.Y>>6) + dY
	x := 0 - int(gbuf.Bounds.Min.X>>6) + dX

	drawer.Dot = fixed.Point26_6{
		X: fixed.I(x),
		Y: fixed.I(y),
	}
	drawer.DrawString(s)

	return dst
}
1145220
func (c *Context) DrawElements(mode, count, typ, offset int) {
	c.Call("drawElements", mode, count, typ, offset)
}