当前位置: 首页>>代码示例>>C++>>正文


C++ cairo_scaled_font_destroy函数代码示例

本文整理汇总了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;
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:28,代码来源:FontPlatformDataFreeType.cpp

示例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;
}
开发者ID:IngenicC,项目名称:xboot,代码行数:35,代码来源:l-font.c

示例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;
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:28,代码来源:FontPlatformDataFreeType.cpp

示例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;
}
开发者ID:atizo,项目名称:pycairo,代码行数:28,代码来源:pycairo-font.c

示例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));
}
开发者ID:AZed,项目名称:cairo,代码行数:29,代码来源:scaled-font-zero-matrix.c

示例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;
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:26,代码来源:FontPlatformDataCairoWin.cpp

示例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;
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:30,代码来源:FontPlatformDataPango.cpp

示例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;
}
开发者ID:anarcher,项目名称:enso-launcher-continued,代码行数:59,代码来源:cairo-meta-surface.c

示例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);
   }
 }
开发者ID:JBouron,项目名称:polybar,代码行数:8,代码来源:font.hpp

示例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);
}
开发者ID:muntyan,项目名称:pycairo-gtk-win32,代码行数:8,代码来源:font.c

示例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;
}
开发者ID:IngenicC,项目名称:xboot,代码行数:9,代码来源:l-font.c

示例12: SkSafeUnref

ScaledFontBase::~ScaledFontBase()
{
#ifdef USE_SKIA
  SkSafeUnref(mTypeface);
#endif
#ifdef USE_CAIRO_SCALED_FONT
  cairo_scaled_font_destroy(mScaledFont);
#endif
}
开发者ID:hoosteeno,项目名称:gecko-dev,代码行数:9,代码来源:ScaledFontBase.cpp

示例13: cairo_font_face_destroy

gfxDWriteFont::~gfxDWriteFont()
{
    if (mCairoFontFace) {
        cairo_font_face_destroy(mCairoFontFace);
    }
    if (mCairoScaledFont) {
        cairo_scaled_font_destroy(mCairoScaledFont);
    }
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:9,代码来源:gfxDWriteFonts.cpp

示例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;
}
开发者ID:muntyan,项目名称:pycairo-gtk-win32,代码行数:24,代码来源:font.c

示例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();
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:9,代码来源:SimpleFontDataCairoWin.cpp


注:本文中的cairo_scaled_font_destroy函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。