// SetFontWithStyle : set font style support Regular or Underline
// for Bold|Italic should be loaded apropriate fonts with same styles defined
549880
func (gp *GoPdf) SetFontWithStyle(family string, style int, size int) error {

	found := false
	i := 0
	max := len(gp.pdfObjs)
	for i < max {
		if gp.pdfObjs[i].getType() == subsetFont {
			obj := gp.pdfObjs[i]
			sub, ok := obj.(*SubsetFontObj)
			if ok {
				if sub.GetFamily() == family && sub.GetTtfFontOption().Style == style&^Underline {
					gp.curr.Font_Size = size
					gp.curr.Font_Style = style
					gp.curr.Font_FontCount = sub.CountOfFont
					gp.curr.Font_ISubset = sub
					found = true
					break
				}
			}
		}
		i++
	}

	if !found {
		return errors.New("not found font family")
	}

	return nil
}
539164
func (cr *Context) SetScaledFont(scaledFont *ScaledFont) {
	C.cairo_set_scaled_font(cr.Ptr, scaledFont.Ptr)
	if err := cr.status(); err != nil {
		panic(err)
	}
}
1175613
func (rr *rasterRenderer) SetFontColor(c drawing.Color) {
	rr.s.FontColor = c
}
631799
func (s *ImportJobResource) SetFormat(v string) *ImportJobResource {
	s.Format = &v
	return s
}
709116
func (rgc *RasterGraphicContext) SetFont(font *truetype.Font) {
	rgc.current.Font = font
}
617993
func (s *DvbSubDestinationSettings) SetFontSize(v string) *DvbSubDestinationSettings {
	s.FontSize = &v
	return s
}
1255540
func (b *BoxLayout) SetStyle(style tcell.Style) {
	b.style = style
	b.PostEventWidgetContent(b)
}
474456
func (p *Theme) HasStyle(name string) bool {
	_, ok := p.styles[name]
	return ok
}
854497
func (c *Page) SetFontFamiliesWithParams(v *PageSetFontFamiliesParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Page.setFontFamilies", Params: v})
}
608854
func (t *TextBar) SetStyle(style tcell.Style) {
	t.initialize()
	t.style = style
}
1249750
func (vr *vectorRenderer) SetFontColor(c drawing.Color) {
	vr.s.FontColor = c
}
794973
func (t *Text) SetStyle(style tcell.Style) {
	t.style = style
	for i := 0; i < len(t.text); i++ {
		if t.widths[i] != 0 {
			t.styles[i] = t.style
		}
	}
	t.PostEventWidgetContent(t)
}
948752
func (s *TtmlDestinationSettings) SetStylePassthrough(v string) *TtmlDestinationSettings {
	s.StylePassthrough = &v
	return s
}
1171857
func (cr *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight) {
	c_family := C.CString(family)
	defer C.free(unsafe.Pointer(c_family))
	C.cairo_select_font_face(cr.Ptr, c_family, C.cairo_font_slant_t(slant), C.cairo_font_weight_t(weight))
	if err := cr.status(); err != nil {
		panic(err)
	}
}
472072
func (gp *GoPdf) SetFont(family string, style string, size int) error {
	return gp.SetFontWithStyle(family, getConvertedStyle(style), size)
}
1178735
func (s Style) GetFontSize(defaults ...float64) float64 {
	if s.FontSize == 0 {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return DefaultFontSize
	}
	return s.FontSize
}
1134534
func (rr *rasterRenderer) SetFont(f *truetype.Font) {
	rr.s.Font = f
}