Example #1
0
func (self *Surface) SelectFontFace(name string, font_slant_t, font_weight_t int) {
	s := C.CString(name)
	C.cairo_select_font_face(self.context, s, C.cairo_font_slant_t(font_slant_t), C.cairo_font_weight_t(font_weight_t))
	C.free(unsafe.Pointer(s))
}
Example #2
0
func (self *Surface) SelectFontFace(name string, font_slant FontSlant, font_weight FontWeight) {
	p := C.CString(name)
	C.cairo_select_font_face(self.context, p, C.cairo_font_slant_t(font_slant), C.cairo_font_weight_t(font_weight))
	C.free(unsafe.Pointer(p))
}
Example #3
0
func (v *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight) {
	cstr := C.CString(family)
	defer C.free(unsafe.Pointer(cstr))
	C.cairo_select_font_face(v.native(), (*C.char)(cstr), C.cairo_font_slant_t(slant), C.cairo_font_weight_t(weight))
}
Example #4
0
//SelectFont selects a family and style of font from a simplified
//description as a family name, slant and weight.
//
//Libcairo provides no operation to list available family names
//on the system, as this is part of the toy api.
//The standard CSS2 generic family names, ("serif", "sans-serif", "cursive",
//"fantasy", "monospace"), are likely to work as expected.
//
//If family starts with the string "cairo:", or if no native font backends are
//compiled in, libcairo will use an internal font family.
//
//If text is drawn without a call to SelectFont or SetFont
//or SetScaledFont, the platform-specific default family is used, typically
//"sans-serif", and the default slant is SlantNormal and the default weight
//is WeightNormal.
//
//For "real" see the font-backend-specific factor functions for the font
//backend you are using.
//The resulting font face could then be used with ScaledFontCreate and
//SetScaledFont.
//
//Note
//
//SelectFont is part of the "toy" text API.
//
//Originally cairo_select_font_face.
func (c *Context) SelectFont(family string, slant slant, weight weight) *Context {
	f := C.CString(family)
	C.cairo_select_font_face(c.c, f, slant.c(), weight.c())
	C.free(unsafe.Pointer(f))
	return c
}