本文整理汇总了C++中FcFontSetDestroy函数的典型用法代码示例。如果您正苦于以下问题:C++ FcFontSetDestroy函数的具体用法?C++ FcFontSetDestroy怎么用?C++ FcFontSetDestroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FcFontSetDestroy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: FcConfigSetFonts
void
FcConfigSetFonts (FcConfig *config,
FcFontSet *fonts,
FcSetName set)
{
if (config->fonts[set])
FcFontSetDestroy (config->fonts[set]);
config->fonts[set] = fonts;
}
开发者ID:tizenorg,项目名称:framework.graphics.fontconfig,代码行数:9,代码来源:fccfg.c
示例2: cc_common_language_has_font
gboolean
cc_common_language_has_font (const gchar *locale)
{
const FcCharSet *charset;
FcPattern *pattern;
FcObjectSet *object_set;
FcFontSet *font_set;
gchar *language_code;
gboolean is_displayable;
is_displayable = FALSE;
pattern = NULL;
object_set = NULL;
font_set = NULL;
if (!gdm_parse_language_name (locale, &language_code, NULL, NULL, NULL))
return FALSE;
charset = FcLangGetCharSet ((FcChar8 *) language_code);
if (!charset) {
/* fontconfig does not know about this language */
is_displayable = TRUE;
}
else {
/* see if any fonts support rendering it */
pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
if (pattern == NULL)
goto done;
object_set = FcObjectSetCreate ();
if (object_set == NULL)
goto done;
font_set = FcFontList (NULL, pattern, object_set);
if (font_set == NULL)
goto done;
is_displayable = (font_set->nfont > 0);
}
done:
if (font_set != NULL)
FcFontSetDestroy (font_set);
if (object_set != NULL)
FcObjectSetDestroy (object_set);
if (pattern != NULL)
FcPatternDestroy (pattern);
g_free (language_code);
return is_displayable;
}
开发者ID:3dfxmadscientist,项目名称:cinnamon-control-center,代码行数:57,代码来源:cc-common-language.c
示例3: FcConfigDestroy
void
FcConfigDestroy (FcConfig *config)
{
FcSetName set;
FcExprPage *page;
if (--config->ref > 0)
return;
if (config == _fcConfig)
_fcConfig = 0;
FcStrSetDestroy (config->configDirs);
FcStrSetDestroy (config->fontDirs);
FcStrSetDestroy (config->cacheDirs);
FcStrSetDestroy (config->configFiles);
FcStrSetDestroy (config->acceptGlobs);
FcStrSetDestroy (config->rejectGlobs);
FcFontSetDestroy (config->acceptPatterns);
FcFontSetDestroy (config->rejectPatterns);
if (config->blanks)
FcBlanksDestroy (config->blanks);
FcSubstDestroy (config->substPattern);
FcSubstDestroy (config->substFont);
FcSubstDestroy (config->substScan);
for (set = FcSetSystem; set <= FcSetApplication; set++)
if (config->fonts[set])
FcFontSetDestroy (config->fonts[set]);
page = config->expr_pool;
while (page)
{
FcExprPage *next = page->next_page;
FcMemFree (FC_MEM_EXPR, sizeof (FcExprPage));
free (page);
page = next;
}
free (config);
FcMemFree (FC_MEM_CONFIG, sizeof (FcConfig));
}
开发者ID:Fur1ok,项目名称:fontconfig,代码行数:43,代码来源:fccfg.c
示例4: FcFontSetDestroy
FontPlatformData::~FontPlatformData()
{
if (m_fallbacks) {
FcFontSetDestroy(m_fallbacks);
m_fallbacks = 0;
}
if (m_scaledFont && m_scaledFont != hashTableDeletedFontValue())
cairo_scaled_font_destroy(m_scaledFont);
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:10,代码来源:FontPlatformDataFreeType.cpp
示例5: fontconf
int fontconf()
{
FcFontSet* fs = NULL;
FcPattern* pat = NULL;
FcObjectSet* os = NULL;
FcChar8* strpat = (FcChar8*) ":lang=ja";
pat = FcNameParse(strpat);
os = FcObjectSetBuild(FC_FAMILY, FC_CHARSET, FC_FILE, (char *) 0);
fs = FcFontList(0, pat, os);
if (os)
FcObjectSetDestroy(os);
os = NULL;
FcPatternDestroy(pat);
pat = NULL;
if (!fs || fs->nfont <= 0)
goto nofont;
FcChar8 *family;
FcChar8 *file;
FcCharSet* cs;
FcChar32 ch;
FcUtf8ToUcs4((FcChar8*) "��", &ch, 3);
int i;
for (i = 0; i < fs->nfont; i++)
{
if (FcPatternGetCharSet(fs->fonts[i], FC_CHARSET, 0, &cs)
!= FcResultMatch)
{
fprintf(stderr, "no match\n");
FcPatternPrint(fs->fonts[i]);
goto nofont;
}
if(FcPatternGetString(fs->fonts[i], FC_FAMILY, 1, &family) !=FcResultMatch)
if(FcPatternGetString(fs->fonts[i], FC_FAMILY, 0, &family) != FcResultMatch)
goto nofont;
printf("[%d] %s ", i, (char *)family);
if(FcPatternGetString(fs->fonts[i], FC_FILE, 0, &file) != FcResultMatch)
goto nofont;
printf("(%s): ", (char *)file);
if(FcCharSetHasChar(cs, ch)){
puts("Yes");
}else{
puts("No");
}
}
FcFontSetDestroy(fs);
return 0;
nofont: return 1;
}
开发者ID:cubezone,项目名称:zaOS,代码行数:55,代码来源:zaAppBase.cpp
示例6: SetFallbackFont
bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, SetFallbackFontCallback *callback)
{
if (!FcInit()) return false;
bool ret = false;
/* Fontconfig doesn't handle full language isocodes, only the part
* before the _ of e.g. en_GB is used, so "remove" everything after
* the _. */
char lang[16];
seprintf(lang, lastof(lang), ":lang=%s", language_isocode);
char *split = strchr(lang, '_');
if (split != NULL) *split = '\0';
/* First create a pattern to match the wanted language. */
FcPattern *pat = FcNameParse((FcChar8*)lang);
/* We only want to know the filename. */
FcObjectSet *os = FcObjectSetBuild(FC_FILE, NULL);
/* Get the list of filenames matching the wanted language. */
FcFontSet *fs = FcFontList(NULL, pat, os);
/* We don't need these anymore. */
FcObjectSetDestroy(os);
FcPatternDestroy(pat);
if (fs != NULL) {
for (int i = 0; i < fs->nfont; i++) {
FcPattern *font = fs->fonts[i];
FcChar8 *file = NULL;
FcResult res = FcPatternGetString(font, FC_FILE, 0, &file);
if (res != FcResultMatch || file == NULL) {
continue;
}
strecpy(settings->small_font, (const char*)file, lastof(settings->small_font));
strecpy(settings->medium_font, (const char*)file, lastof(settings->medium_font));
strecpy(settings->large_font, (const char*)file, lastof(settings->large_font));
bool missing = callback(NULL);
DEBUG(freetype, 1, "Font \"%s\" misses%s glyphs", file, missing ? "" : " no");
if (!missing) {
ret = true;
break;
}
}
/* Clean up the list of filenames. */
FcFontSetDestroy(fs);
}
FcFini();
return ret;
}
开发者ID:ShaunOfTheLive,项目名称:OpenCoasterTycoon,代码行数:55,代码来源:fontcache.cpp
示例7: FcConfigDestroy
void
FcConfigDestroy (FcConfig *config)
{
FcSetName set;
FcExprPage *page;
if (FcRefDec (&config->ref) != 1)
return;
(void) fc_atomic_ptr_cmpexch (&_fcConfig, config, NULL);
FcStrSetDestroy (config->configDirs);
FcStrSetDestroy (config->fontDirs);
FcStrSetDestroy (config->cacheDirs);
FcStrSetDestroy (config->configFiles);
FcStrSetDestroy (config->acceptGlobs);
FcStrSetDestroy (config->rejectGlobs);
FcFontSetDestroy (config->acceptPatterns);
FcFontSetDestroy (config->rejectPatterns);
if (config->blanks)
FcBlanksDestroy (config->blanks);
FcSubstDestroy (config->substPattern);
FcSubstDestroy (config->substFont);
FcSubstDestroy (config->substScan);
for (set = FcSetSystem; set <= FcSetApplication; set++)
if (config->fonts[set])
FcFontSetDestroy (config->fonts[set]);
page = config->expr_pool;
while (page)
{
FcExprPage *next = page->next_page;
free (page);
page = next;
}
if (config->sysRoot)
FcStrFree (config->sysRoot);
free (config);
}
开发者ID:Adenilson,项目名称:libfontconfig,代码行数:42,代码来源:fccfg.c
示例8: gp_enumerate_fonts_free
void gp_enumerate_fonts_free(void *enum_state)
{
#ifdef HAVE_FONTCONFIG
unix_fontenum_t* state = (unix_fontenum_t *)enum_state;
if (state != NULL) {
if (state->font_list != NULL)
FcFontSetDestroy(state->font_list);
free(state);
}
#endif
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:11,代码来源:gp_unix.c
示例9: FcFontSetDestroy
FontPlatformData::~FontPlatformData()
{
#if !PLATFORM(JS)
if (m_fallbacks) {
FcFontSetDestroy(m_fallbacks);
m_fallbacks = 0;
}
#endif
if (m_scaledFont && m_scaledFont != hashTableDeletedFontValue())
cairo_scaled_font_destroy(m_scaledFont);
}
开发者ID:Web5design,项目名称:webkit.js,代码行数:11,代码来源:FontPlatformDataFreeType.cpp
示例10: fcinfo
FcFontSet * fcinfo(const FcConfig *config, const FcPattern *pattern,
FcBool remove_duplicities, int argnum, ...)
{
va_list va;
const char *elements[argnum + 1];
int a;
FcFontSet *fontset;
FcObjectSet *objectset;
FcInit();
objectset = FcObjectSetCreate();
va_start(va, argnum);
for (a = 0; a < argnum; a++)
{
elements[a] = va_arg(va, const char *);
FcObjectSetAdd(objectset, elements[a]);
}
va_end(va);
fontset = FcFontList((FcConfig *)config, (FcPattern *)pattern, objectset);
elements[argnum] = NULL;
font_set_sort(fontset, elements);
FcObjectSetDestroy(objectset);
if (remove_duplicities)
{
FcFontSet *result = FcFontSetCreate();
int f;
FcPattern *added = NULL;
/* fontlist is linearly ordered */
f = 0;
while (f < fontset->nfont)
{
FcFontSetAdd(result, FcPatternDuplicate(fontset->fonts[f]));
added = fontset->fonts[f++];
while (f < fontset->nfont &&
!pattern_compare(&fontset->fonts[f], &added, elements))
f++;
}
FcFontSetDestroy(fontset);
return result;
}
return fontset;
}
开发者ID:pgajdos,项目名称:fontinfo,代码行数:50,代码来源:fcinfo.c
示例11: FcPatternDestroy
void SimpleFontData::platformDestroy()
{
if (m_platformData.m_pattern && ((FcPattern*)-1 != m_platformData.m_pattern)) {
FcPatternDestroy(m_platformData.m_pattern);
m_platformData.m_pattern = 0;
}
if (m_platformData.m_fallbacks) {
FcFontSetDestroy(m_platformData.m_fallbacks);
m_platformData.m_fallbacks = 0;
}
if (m_smallCapsFontData)
delete m_smallCapsFontData;
m_smallCapsFontData = NULL;
}
开发者ID:ezrec,项目名称:owb-mirror,代码行数:16,代码来源:BCSimpleFontDataFreetype.cpp
示例12: lltxplatform_get_installed_fonts_impl
int lltxplatform_get_installed_fonts_impl(struct lltxplatform_fontinfo **const fonts, unsigned int *const count) {
int status = -1;
FcPattern *const pattern = FcPatternCreate();
if (pattern != NULL) {
FcObjectSet *const objects = FcObjectSetBuild(FC_FULLNAME, FC_FILE, NULL);
if (objects != NULL) {
FcFontSet *const list = FcFontList(NULL, pattern, objects);
if (list != NULL) {
if (list->nfont > 0) {
const unsigned int cnt = (unsigned int) list->nfont;
struct lltxplatform_fontinfo *const array = (struct lltxplatform_fontinfo *) calloc((size_t) cnt, sizeof(struct lltxplatform_fontinfo));
if (array != NULL) {
unsigned int i;
status = 0;
for (i = 0; i < cnt; ++i) {
struct lltxplatform_fontinfo *const info = &array[i];
FcPattern *const font = list->fonts[i];
FcChar8 *value;
if (FcPatternGetString(font, FC_FULLNAME, 0, &value) == FcResultMatch) {
info->name = strdup((char *) value);
} else {
info->name = NULL;
}
if (FcPatternGetString(font, FC_FILE, 0, &value) == FcResultMatch) {
info->path = strdup((char *) value);
} else {
info->path = NULL;
}
}
*count = cnt;
*fonts = array;
}
} else {
status = 0;
*count = 0;
*fonts = NULL;
}
FcFontSetDestroy(list);
}
FcObjectSetDestroy(objects);
}
FcPatternDestroy(pattern);
}
return status;
}
开发者ID:eroux,项目名称:lltxplatform,代码行数:45,代码来源:fonts_fontconfig.c
示例13: FcListFonts
GeeArrayList *
FcListFonts(gchar * family_name)
{
int i;
FcPattern * pattern;
FcFontSet * fontset;
FcObjectSet * objectset = 0;
GeeArrayList * fontlist = gee_array_list_new(G_TYPE_OBJECT,
NULL,
NULL,
NULL,
NULL,
NULL);
g_assert(FcInit());
if (family_name)
pattern = FcPatternBuild (NULL, FC_FAMILY, FcTypeString, family_name, NULL);
else
pattern = FcNameParse((FcChar8 *) ":");
objectset = FcObjectSetBuild (FC_FILE,
FC_INDEX,
FC_FAMILY,
FC_STYLE,
FC_SLANT,
FC_WEIGHT,
FC_WIDTH,
FC_SPACING,
NULL);
fontset = FcFontList(NULL, pattern, objectset);
for (i = 0; i < fontset->nfont; i++) {
FontConfigFont * font = font_config_font_new();
get_font_details_from_pattern(font, fontset->fonts[i]);
gee_abstract_collection_add((GeeAbstractCollection *) fontlist, font);
}
if (objectset)
FcObjectSetDestroy(objectset);
if (pattern)
FcPatternDestroy(pattern);
if (fontset)
FcFontSetDestroy(fontset);
return fontlist;
}
开发者ID:Heether,项目名称:font-manager,代码行数:45,代码来源:_Glue_.c
示例14: evas_fonts_zero_free
void
evas_fonts_zero_free(Evas *eo_evas)
{
Fndat *fd;
Evas_Public_Data *evas = eo_data_get(eo_evas, EVAS_CLASS);
EINA_LIST_FREE(fonts_zero, fd)
{
if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
if (fd->source) eina_stringshare_del(fd->source);
evas->engine.func->font_free(evas->engine.data.output, fd->font);
#ifdef HAVE_FONTCONFIG
if (fd->set) FcFontSetDestroy(fd->set);
if (fd->p_nm) FcPatternDestroy(fd->p_nm);
#endif
free(fd);
}
}
开发者ID:wjhendr,项目名称:enlightenment,代码行数:18,代码来源:evas_font_dir.c
示例15: FcInit
FcFontSet *fcinfo_font_index(const FcPattern *filter)
{
FcFontSet *result, *fontset;
FcInit();
fontset = fcinfo(NULL, filter, FcFalse, 5,
FC_FAMILY,
FC_STYLE,
FC_LANG,/* fonts like Misc Fixed need
to be sorted by LANG (subset-like) */
FC_PIXEL_SIZE,
FC_FILE); /* for identifying the best font in
FC_LANG terms */
result = fcinfo_match(fontset, NULL);
FcFontSetDestroy(fontset);
return result;
}
开发者ID:pgajdos,项目名称:fontinfo,代码行数:19,代码来源:fcinfo.c
示例16: font_view_model_finalize
static void
font_view_model_finalize (GObject *obj)
{
FontViewModel *self = FONT_VIEW_MODEL (obj);
if (self->priv->font_list) {
FcFontSetDestroy (self->priv->font_list);
self->priv->font_list = NULL;
}
if (self->priv->library != NULL) {
FT_Done_FreeType (self->priv->library);
self->priv->library = NULL;
}
g_list_free_full (self->priv->monitors, (GDestroyNotify) g_object_unref);
G_OBJECT_CLASS (font_view_model_parent_class)->finalize (obj);
}
开发者ID:rkmax,项目名称:gnome-font-viewer,代码行数:19,代码来源:font-model.c
示例17: shoes_load_font
VALUE
shoes_load_font(const char *filename)
{
FcConfig *fc = FcConfigGetCurrent();
FcFontSet *fonts = FcFontSetCreate();
if (!FcFileScan(fonts, NULL, NULL, NULL, (const FcChar8 *)filename, FcTrue))
return Qnil;
VALUE ary = rb_ary_new();
shoes_make_font_list(fonts, ary);
FcFontSetDestroy(fonts);
if (!FcConfigAppFontAddFile(fc, (const FcChar8 *)filename))
return Qnil;
// refresh the FONTS list
shoes_update_fonts(shoes_font_list());
return ary;
}
开发者ID:whymirror,项目名称:shoes,代码行数:19,代码来源:gtk.c
示例18: GdipDeletePrivateFontCollection
// coverity[+free : arg-0]
GpStatus
GdipDeletePrivateFontCollection (GpFontCollection **font_collection)
{
if (!font_collection)
return InvalidParameter;
if (*font_collection) {
if ((*font_collection)->fontset != NULL) {
FcFontSetDestroy ((*font_collection)->fontset);
(*font_collection)->fontset = NULL;
}
if ((*font_collection)->config != NULL) {
FcConfigDestroy ((*font_collection)->config);
(*font_collection)->config = NULL;
}
GdipFree ((void *)*font_collection);
}
return Ok;
}
开发者ID:haf,项目名称:libgdiplus,代码行数:21,代码来源:font.c
示例19: evas_font_free
void
evas_font_free(Evas *eo_evas, void *font)
{
Eina_List *l;
Fndat *fd;
Evas_Public_Data *evas = eo_data_get(eo_evas, EVAS_CLASS);
EINA_LIST_FOREACH(fonts_cache, l, fd)
{
if (fd->font == font)
{
fd->ref--;
if (fd->ref == 0)
{
fonts_cache = eina_list_remove_list(fonts_cache, l);
fonts_zero = eina_list_append(fonts_zero, fd);
}
break;
}
}
while (fonts_zero
&& eina_list_count(fonts_zero) > 42) /* 42 is arbitrary */
{
fd = eina_list_data_get(fonts_zero);
if (fd->ref != 0) break;
fonts_zero = eina_list_remove_list(fonts_zero, fonts_zero);
if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
if (fd->source) eina_stringshare_del(fd->source);
evas->engine.func->font_free(evas->engine.data.output, fd->font);
#ifdef HAVE_FONTCONFIG
if (fd->set) FcFontSetDestroy(fd->set);
if (fd->p_nm) FcPatternDestroy(fd->p_nm);
#endif
free(fd);
if (eina_list_count(fonts_zero) < 43) break;
}
}
开发者ID:wjhendr,项目名称:enlightenment,代码行数:40,代码来源:evas_font_dir.c
示例20: FcListFamilies
GeeArrayList *
FcListFamilies(void)
{
int i;
FcPattern * pattern;
FcFontSet * fontset;
FcObjectSet * objectset = 0;
GeeArrayList * famlist = gee_array_list_new(G_TYPE_STRING,
(GBoxedCopyFunc) g_strdup,
(GDestroyNotify) g_free0,
NULL,
NULL,
NULL);
g_assert(FcInit());
pattern = FcNameParse((FcChar8 *) ":");
objectset = FcObjectSetBuild (FC_FAMILY, NULL);
fontset = FcFontList(NULL, pattern, objectset);
for (i = 0; i < fontset->nfont; i++) {
FcChar8 * family;
if (FcPatternGetString(fontset->fonts[i], FC_FAMILY, 0, &family) == FcResultMatch) {
if (gee_abstract_collection_contains((GeeAbstractCollection *) famlist, family))
continue;
else
gee_abstract_collection_add((GeeAbstractCollection *) famlist, family);
}
}
if (objectset)
FcObjectSetDestroy(objectset);
if (pattern)
FcPatternDestroy(pattern);
if (fontset)
FcFontSetDestroy(fontset);
return famlist;
}
开发者ID:Heether,项目名称:font-manager,代码行数:37,代码来源:_Glue_.c
注:本文中的FcFontSetDestroy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论