コード例 #1
0
static int new_UserFontFace (lua_State *L)
{
    lua_remove(L, 1); // remove cairo.UserFontFace

    cairo_font_face_t *ff = cairo_user_font_face_create ();

    return new_FontFace(L, LUACAIRO ".UserFontFace.mt", ff, CAIRO_FONT_TYPE_USER, 1);
}
コード例 #2
0
static int new_ToyFontFace (lua_State *L)
{
    const char *family;
    cairo_font_slant_t slant;
    cairo_font_weight_t weight;
    cairo_font_face_t *ff;

    lua_remove(L, 1); // remove cairo.ToyFontFace

    family = luaL_checkstring(L, 1);
    slant = (cairo_font_slant_t) luaL_checkinteger(L, 2);
    weight = (cairo_font_weight_t) luaL_checkinteger(L, 3);
    ff = cairo_toy_font_face_create (family, slant, weight);

    return new_FontFace(L, LUACAIRO ".ToyFontFace.mt", ff, CAIRO_FONT_TYPE_TOY, 1);
}