Re: Re: Xft2, can I turn of hinting?

David Reveman <[email protected]>
Newsgroups gmane.comp.xfree86.render
Message-ID <[email protected]>
> $ man fontconfig
> ...
>        hinting   FC_HINTING       Bool    Whether the rasterizer should use
> hin! ...

I added this to fonts.conf:

<match target="pattern">
      <test qual="any" name="family">
         <string>arial</string>
      </test>
      <edit name="hinting" mode="assign">
         <bool>false</bool>
      </edit>
   </match>

But when running the following program:
#include <stdio.h>
#include <X11/Xlib.h>
#include <fontconfig/fontconfig.h>

int main(int argc, char **argv) {
  Display *display;
  int screen;
  FcPattern *pattern;
  FcResult *result;

  if (argc < 2) {
    fprintf(stderr, "Usage: %s FONTNAME\n", *argv);
    exit(1);
  }
  display = XOpenDisplay(NULL);
  screen = DefaultScreen(display);
  pattern = FcNameParse(argv[1]);
  FcDefaultSubstitute(pattern);
  pattern = FcFontMatch(FcConfigGetCurrent(), pattern, result);
  FcPatternPrint(pattern);
  XCloseDisplay(display);
  exit(0);
}

It prints the following output:
Pattern 18 of 32
        family: "Arial"
        style: "Italic"
        slant: 100
        weight: 100
        index: 0
        outline: FcTrue
        scalable: FcTrue
        charset: set
        lang: "latin1"
        file: "/usr/X11R6/lib/X11/fonts/TrueType/ariali.ttf"
        hinting: FcTrue
        verticallayout: FcFalse
        autohint: FcFalse
        globaladvance: FcTrue
        size: 12
        scale: 1
        dpi: 75
        pixelsize: 12.5

hinting still True.
Did I write the fonts.conf wrong?
Maybe the problem is in my small program.

when modifing fcdefaults.c so that:
FcBoolDefaults[] = {
    { FC_HINTING,     FcFalse },  /* !FT_LOAD_NO_HINTING */
    { FC_VERTICAL_LAYOUT,   FcFalse },  /* FC_LOAD_VERTICAL_LAYOUT */
    { FC_AUTOHINT,       FcFalse },  /* FC_LOAD_FORCE_AUTOHINT */
    { FC_GLOBAL_ADVANCE,    FcTrue  },  /* 
!FC_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
};

It works,
 but it would be nice if I could just disable hinting for some of my fonts.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.