ArcticaProject / nx-libs

nx-libs
Other
120 stars 39 forks source link

Investigate building nx-libs against libXfont2 #296

Closed sunweaver closed 7 years ago

sunweaver commented 7 years ago

The X.org project has worked on a new libXfont implementation, named libXfont2. We should condider converting nx-libs to build against the new libXfont2 API.

sunweaver commented 7 years ago

Porting to libXfont2 should be pretty easy:

[mike@minobo xserver (master)]$ grep -r xfont2_ *
dix/dispatch.c:    if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info))
dix/dixfonts.c:static xfont2_fpe_funcs_rec const **fpe_functions;
dix/dixfonts.c:static xfont2_pattern_cache_ptr patternCache;
dix/dixfonts.c:        xfont2_cache_font_pattern(patternCache, c->origFontName, c->origFontNameLen,
dix/dixfonts.c:        cached = xfont2_find_cached_font_pattern(patternCache, pfontname, lenfname);
dix/dixfonts.c:            xfont2_remove_cached_font_pattern(patternCache, pfont);
dix/dixfonts.c:                        (void) xfont2_add_font_names_name(c->names, c->savedName,
dix/dixfonts.c:                    (void) xfont2_add_font_names_name(c->names, name, namelen);
dix/dixfonts.c:    xfont2_free_font_names(names);
dix/dixfonts.c:    c->names = xfont2_make_font_names_record(max_names < 100 ? max_names : 100);
dix/dixfonts.c:        xfont2_empty_font_pattern_cache(patternCache);
dix/dixfonts.c:register_fpe_funcs(const xfont2_fpe_funcs_rec *funcs)
dix/dixfonts.c:    xfont2_fpe_funcs_rec const **new;
dix/dixfonts.c:    new = reallocarray(fpe_functions, num_fpe_types + 1, sizeof(xfont2_fpe_funcs_ptr));
dix/dixfonts.c:        xfont2_free_font_pattern_cache(patternCache);
dix/dixfonts.c:static const xfont2_client_funcs_rec xfont2_client_funcs = {
dix/dixfonts.c:xfont2_pattern_cache_ptr fontPatternCache;
dix/dixfonts.c: xfont2_free_font_pattern_cache(fontPatternCache);
dix/dixfonts.c:    fontPatternCache = xfont2_make_font_pattern_cache();
dix/dixfonts.c:    xfont2_init(&xfont2_client_funcs);
dix/main.c:        xfont2_init_glyph_caching();
glamor/glamor_font.c:        xfont2_font_set_private(font, glamor_font_private_index, privates);
glamor/glamor_font.c:    xfont2_font_set_private(font, glamor_font_private_index, NULL);
glamor/glamor_font.c:        glamor_font_private_index = xfont2_allocate_font_private_index();
hw/xnest/Font.c:    xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
hw/xnest/Font.c:    xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv);
hw/xnest/Font.c:        xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
hw/xnest/Init.c:    xnestFontPrivateIndex = xfont2_allocate_font_private_index();
hw/dmx/dmxscrinit.c:        dmxFontPrivateIndex = xfont2_allocate_font_private_index();
hw/dmx/dmxfont.c:        xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL);
hw/dmx/dmxfont.c:    xfont2_font_set_private(pFont, dmxFontPrivateIndex, (void *) pFontPriv);
hw/dmx/dmxfont.c:            xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL);
hw/dmx/dmxfont.c:                xfont2_font_set_private(pFont, dmxFontPrivateIndex, NULL);
mi/miglblt.c:    ExtentInfoRec info;         /* used by xfont2_query_glyph_extents() */
mi/miglblt.c:    xfont2_query_glyph_extents(pGC->font, ppci, (unsigned long) nglyph, &info);
miext/damage/damage.c:    xfont2_query_glyph_extents(font, charinfo, n, &extents);
os/utils.c:            if (++i >= argc || !xfont2_parse_glyph_caching_mode(argv[i]))
Xext/xf86bigfont.c:                if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) {
Xext/xf86bigfont.c:        FontShmdescIndex = xfont2_allocate_font_private_index();

However, we need to keep support for libXfont1 around for a while, too. So the porting will be an ifdef-else-endif pita.