本文整理汇总了C++中cairo_scaled_font_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ cairo_scaled_font_destroy函数的具体用法?C++ cairo_scaled_font_destroy怎么用?C++ cairo_scaled_font_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cairo_scaled_font_destroy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FcFontSetDestroy
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
{
// Check for self-assignment.
if (this == &other)
return *this;
m_size = other.m_size;
m_syntheticBold = other.m_syntheticBold;
m_syntheticOblique = other.m_syntheticOblique;
m_fixedWidth = other.m_fixedWidth;
m_pattern = other.m_pattern;
m_orientation = other.m_orientation;
m_horizontalOrientationMatrix = other.m_horizontalOrientationMatrix;
if (m_fallbacks) {
FcFontSetDestroy(m_fallbacks);
// This will be re-created on demand.
m_fallbacks = 0;
}
if (m_scaledFont && m_scaledFont != hashTableDeletedFontValue())
cairo_scaled_font_destroy(m_scaledFont);
m_scaledFont = cairo_scaled_font_reference(other.m_scaledFont);
m_harfBuzzFace = other.m_harfBuzzFace;
return *this;
}
示例2: l_font_new
static int l_font_new(lua_State * L)
{
const char * family = luaL_checkstring(L, 1);
struct lfont_t * font = lua_newuserdata(L, sizeof(struct lfont_t));
if(FT_Init_FreeType(&font->library))
return 0;
if(FT_New_Xfs_Face(font->library, family, 0, &font->fface))
{
FT_Done_FreeType(font->library);
return 0;
}
font->face = cairo_ft_font_face_create_for_ft_face(font->fface, 0);
if(font->face->status != CAIRO_STATUS_SUCCESS)
{
FT_Done_Face(font->fface);
FT_Done_FreeType(font->library);
cairo_font_face_destroy(font->face);
return 0;
}
cairo_font_options_t * options = cairo_font_options_create();
cairo_matrix_t identity;
cairo_matrix_init_identity(&identity);
font->sfont = cairo_scaled_font_create(font->face, &identity, &identity, options);
cairo_font_options_destroy(options);
if(cairo_scaled_font_status(font->sfont) != CAIRO_STATUS_SUCCESS)
{
FT_Done_Face(font->fface);
FT_Done_FreeType(font->library);
cairo_font_face_destroy(font->face);
cairo_scaled_font_destroy(font->sfont);
return 0;
}
luaL_setmetatable(L, MT_FONT);
return 1;
}
示例3: ASSERT
void FontPlatformData::setOrientation(FontOrientation orientation)
{
ASSERT(m_scaledFont);
if (!m_scaledFont || (m_orientation == orientation))
return;
cairo_matrix_t transformationMatrix;
cairo_matrix_init_identity(&transformationMatrix);
cairo_matrix_t fontMatrix;
cairo_scaled_font_get_font_matrix(m_scaledFont, &fontMatrix);
cairo_font_options_t* options = getDefaultFontOptions();
// In case of vertical orientation, rotate the transformation matrix.
// Otherwise restore the horizontal orientation matrix.
if (orientation == Vertical)
rotateCairoMatrixForVerticalOrientation(&fontMatrix);
else
fontMatrix = m_horizontalOrientationMatrix;
cairo_font_face_t* fontFace = cairo_scaled_font_get_font_face(m_scaledFont);
cairo_scaled_font_destroy(m_scaledFont);
m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &transformationMatrix, options);
cairo_font_options_destroy(options);
m_orientation = orientation;
}
示例4: scaled_font_new
static PyObject *
scaled_font_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PycairoFontFace *ff;
PycairoFontOptions *fo;
PycairoMatrix *mx1, *mx2;
if (!PyArg_ParseTuple(args, "O!O!O!O!:ScaledFont.__new__",
&PycairoFontFace_Type, &ff,
&PycairoMatrix_Type, &mx1,
&PycairoMatrix_Type, &mx2,
&PycairoFontOptions_Type, &fo))
return NULL;
PyObject *o = type->tp_alloc(type, 0);
if (o != NULL) {
cairo_scaled_font_t *scaled_font = cairo_scaled_font_create
(ff->font_face, &mx1->matrix, &mx2->matrix, fo->font_options);
if (Pycairo_Check_Status (cairo_scaled_font_status (scaled_font))) {
cairo_scaled_font_destroy (scaled_font);
Py_DECREF(o);
return NULL;
}
((PycairoScaledFont *)o)->scaled_font = scaled_font;
}
return o;
}
示例5: draw
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_font_face_t *font_face;
cairo_font_options_t *font_options;
cairo_scaled_font_t *scaled_font;
cairo_matrix_t identity;
cairo_matrix_t zero;
cairo_matrix_init_identity(&identity);
zero = identity;
cairo_matrix_scale(&zero, 0, 0);
font_face = cairo_get_font_face (cr);
font_options = cairo_font_options_create ();
cairo_get_font_options (cr, font_options);
scaled_font = cairo_scaled_font_create (font_face,
&identity,
&zero,
font_options);
cairo_set_scaled_font (cr, scaled_font);
cairo_show_text (cr, "Hello");
cairo_scaled_font_destroy (scaled_font);
cairo_font_options_destroy (font_options);
return cairo_test_status_from_status (cairo_test_get_context (cr),
cairo_status(cr));
}
示例6: cairo_font_face_reference
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
{
// Check for self-assignment.
if (this == &other)
return *this;
m_font = other.m_font;
m_size = other.m_size;
m_syntheticBold = other.m_syntheticBold;
m_syntheticOblique = other.m_syntheticOblique;
m_useGDI = other.m_useGDI;
if (other.m_fontFace)
cairo_font_face_reference(other.m_fontFace);
if (m_fontFace)
cairo_font_face_destroy(m_fontFace);
m_fontFace = other.m_fontFace;
if (other.m_scaledFont)
cairo_scaled_font_reference(other.m_scaledFont);
if (m_scaledFont)
cairo_scaled_font_destroy(m_scaledFont);
m_scaledFont = other.m_scaledFont;
return *this;
}
示例7: cairo_scaled_font_reference
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
{
// Check for self-assignment.
if (this == &other)
return *this;
m_size = other.m_size;
m_syntheticBold = other.m_syntheticBold;
m_syntheticOblique = other.m_syntheticOblique;
if (other.m_scaledFont)
cairo_scaled_font_reference(other.m_scaledFont);
if (m_scaledFont)
cairo_scaled_font_destroy(m_scaledFont);
m_scaledFont = other.m_scaledFont;
if (other.m_font)
g_object_ref(other.m_font);
if (m_font)
g_object_unref(m_font);
m_font = other.m_font;
if (other.m_context)
g_object_ref(other.m_context);
if (m_context)
g_object_unref(m_context);
m_context = other.m_context;
return *this;
}
示例8: _cairo_meta_surface_finish
static cairo_status_t
_cairo_meta_surface_finish (void *abstract_surface)
{
cairo_meta_surface_t *meta = abstract_surface;
cairo_command_t *command;
cairo_command_t **elements;
int i, num_elements;
num_elements = meta->commands.num_elements;
elements = (cairo_command_t **) meta->commands.elements;
for (i = 0; i < num_elements; i++) {
command = elements[i];
switch (command->type) {
case CAIRO_COMMAND_COMPOSITE:
_cairo_pattern_fini (&command->composite.src_pattern.base);
if (command->composite.mask_pattern_pointer)
_cairo_pattern_fini (command->composite.mask_pattern_pointer);
free (command);
break;
case CAIRO_COMMAND_FILL_RECTANGLES:
free (command->fill_rectangles.rects);
free (command);
break;
case CAIRO_COMMAND_COMPOSITE_TRAPEZOIDS:
_cairo_pattern_fini (&command->composite_trapezoids.pattern.base);
free (command->composite_trapezoids.traps);
free (command);
break;
case CAIRO_COMMAND_INTERSECT_CLIP_PATH:
if (command->intersect_clip_path.path_pointer)
_cairo_path_fixed_fini (&command->intersect_clip_path.path);
free (command);
break;
case CAIRO_COMMAND_SHOW_GLYPHS:
cairo_scaled_font_destroy (command->show_glyphs.scaled_font);
_cairo_pattern_fini (&command->show_glyphs.pattern.base);
free (command->show_glyphs.glyphs);
free (command);
break;
case CAIRO_COMMAND_FILL_PATH:
_cairo_pattern_fini (&command->fill_path.pattern.base);
_cairo_path_fixed_fini (&command->fill_path.path);
free (command);
break;
default:
ASSERT_NOT_REACHED;
}
}
_cairo_array_fini (&meta->commands);
return CAIRO_STATUS_SUCCESS;
}
示例9: cairo_scaled_font_destroy
~font_fc() override {
if (m_scaled != nullptr) {
cairo_scaled_font_destroy(m_scaled);
}
if (m_pattern != nullptr) {
FcPatternDestroy(m_pattern);
}
}
示例10: scaled_font_dealloc
static void
scaled_font_dealloc(PycairoScaledFont *o) {
if (o->scaled_font) {
cairo_scaled_font_destroy (o->scaled_font);
o->scaled_font = NULL;
}
o->ob_type->tp_free((PyObject *) o);
}
示例11: m_font_gc
static int m_font_gc(lua_State * L)
{
struct lfont_t * font = luaL_checkudata(L, 1, MT_FONT);
FT_Done_Face(font->fface);
FT_Done_FreeType(font->library);
cairo_font_face_destroy(font->face);
cairo_scaled_font_destroy(font->sfont);
return 0;
}
示例12: SkSafeUnref
ScaledFontBase::~ScaledFontBase()
{
#ifdef USE_SKIA
SkSafeUnref(mTypeface);
#endif
#ifdef USE_CAIRO_SCALED_FONT
cairo_scaled_font_destroy(mScaledFont);
#endif
}
示例13: cairo_font_face_destroy
gfxDWriteFont::~gfxDWriteFont()
{
if (mCairoFontFace) {
cairo_font_face_destroy(mCairoFontFace);
}
if (mCairoScaledFont) {
cairo_scaled_font_destroy(mCairoScaledFont);
}
}
示例14: PycairoScaledFont_FromScaledFont
/* PycairoScaledFont_FromScaledFont
* Create a new PycairoScaledFont from a cairo_scaled_font_t
* scaled_font - a cairo_scaled_font_t to 'wrap' into a Python object.
* it is unreferenced if the PycairoScaledFont creation fails
* Return value: New reference or NULL on failure
*/
PyObject *
PycairoScaledFont_FromScaledFont (cairo_scaled_font_t *scaled_font) {
PyObject *o;
assert (scaled_font != NULL);
if (Pycairo_Check_Status (cairo_scaled_font_status (scaled_font))) {
cairo_scaled_font_destroy (scaled_font);
return NULL;
}
o = PycairoScaledFont_Type.tp_alloc (&PycairoScaledFont_Type, 0);
if (o == NULL)
cairo_scaled_font_destroy (scaled_font);
else
((PycairoScaledFont *)o)->scaled_font = scaled_font;
return o;
}
示例15: cairo_font_face_destroy
void SimpleFontData::platformDestroy()
{
cairo_font_face_destroy(m_font.fontFace());
cairo_scaled_font_destroy(m_font.scaledFont());
DeleteObject(m_font.hfont());
platformCommonDestroy();
}