• 使用pango-Cairo列出系统中的有效字体


    使用pango-Cairo列出系统中的有效字体,代码来源于gtk-app-devel-list

    fonts list using pango

    #include <glib.h>
    #include <pango/pangocairo.h> 
    
    static void list_fonts ()
    {
        int i;
        PangoFontFamily ** families;
        int n_families;
        PangoFontMap * fontmap; 
    
        fontmap = pango_cairo_font_map_get_default();
        pango_font_map_list_families (fontmap, & families, & n_families);
        printf ("There are %d families
    ", n_families);
        for (i = 0; i < n_families; i++) {
            PangoFontFamily * family = families[i];
            const char * family_name; 
    
            family_name = pango_font_family_get_name (family);
            printf ("Family %d: %s
    ", i, family_name);
        }
        g_free (families);
    } 
    
    int main (int argc, char ** argv)
    {
        list_fonts ();
        return 0;
    } 

    makefile

    pango-list-typefaces:   pango-list-typefaces.c
            cc -o $@ -Wall -g pango-list-typefaces.c 
            `pkg-config --cflags --libs pango` 
            `pkg-config --cflags --libs cairo` 
            `pkg-config --cflags --libs pangocairo` 
            `pkg-config --cflags --libs glib-2.0` 
  • 相关阅读:
    selenium使用
    爬取梨视频
    django实现事务
    django admin模块使用
    跨域问题和django中实现跨域
    Java多线程Condition定点通知
    Java创建线程四种方式
    JVM之JVM体系结构
    Java线程状态
    Java正则表达式解析网页源码
  • 原文地址:https://www.cnblogs.com/arely/p/4416108.html
Copyright © 2020-2023  润新知