bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36028: A native module


From: Tetsumi
Subject: bug#36028: A native module
Date: Tue, 04 Jun 2019 17:45:10 +0000

To overcome this problem i made a native module to configure Xft from emacs:
https://bitbucket.org/Tetsumi/emacs-xft-config/src/master/

Here a demo (webm video): https://webm.red/3Mr9.webm

Please consider adding two procedures in emacs's xftfont.c to set/get the default pattern of Xft, that would give the user total control on font settings.

To get the current default pattern of Xft:

   FcPattern *pat = FcPatternCreate(); // create an empty Font-Config pattern.
   XftDefaultSubstitute(XDisplay, XScreen, pat); // add current defaults for any options not already present in pat. This also add the current defaults from Font-Config
   FcChar8 *ps = FcNameUnparse(pat); // convert pattern to string
   FcPatternDestroy(pat); // free pat.

The set a new default pattern:

   FcPattern *pat = FcNameParse(buf); // create a Font-Config pattern from a string (eg: ":antialias=false;pixelsize=48")
   XftDefaultSubstitute(XDisplay, XScreen, pat); // see above
   XftDefaultSet(XDisplay, pat); // set pat as the new default pattern
// don't destroy pat! xft takes care ot that.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]