Commit Graph

746 Commits

Author SHA1 Message Date
Behdad Esfahbod 5bb5da4c4a Refuse to set value to unsupported types during config too 2013-01-01 20:19:57 -06:00
Behdad Esfahbod 3878a12541 Make FC_DBG_OBJTYPES debug messages into warnings
And remove FC_DBG_OBJTYPES since it has no use now.
2013-01-01 20:19:53 -06:00
Behdad Esfahbod 209750a4e0 Warn if <name target="font"> appears in <match target="pattern"> 2012-12-31 20:11:12 -06:00
Behdad Esfahbod 31ce352bb3 Initialize matrix during name parsing
Before:
$ fc-match sans:matrix=2 -v | grep matrix
	matrix: [2 6.95183e-310; 0 0](s)

After:
$ fc-match sans:matrix=2 -v | grep matrix
	matrix: [2 0; 0 1](s)
2012-12-31 19:56:06 -06:00
Behdad Esfahbod b1630dc00e Enable fcarch assert checks even when FC_ARCHITECTURE is explicitly given
After all, if the asserts fail, the resulting library simply can't be
working correctly.
2012-12-31 17:20:29 -06:00
Behdad Esfahbod a603be89cd Unbreak build when FC_ARCHITECTURE is defined 2012-12-31 17:00:19 -06:00
Behdad Esfahbod 1fbb0b3b15 Don't warn if an unknown element is used in an expression
The type will be resolved at runtime...

For example, we can do this now without getting a warning:

<match target="font">
  <test name="scalable" compare="eq">
    <bool>false</bool>
  </test>
  <edit name="pixelsizefixupfactor" mode="assign">
    <divide>
      <name target="pattern">pixelsize</name>
      <name target="font"   >pixelsize</name>
    </divide>
  </edit>
  <edit name="matrix" mode="assign">
    <times>
      <name>matrix</name>
      <matrix>
        <name>pixelsizefixupfactor</name> <double>0</double>
        <double>0</double> <name>pixelsizefixupfactor</name>
       </matrix>
    </times>
  </edit>
  <edit name="size" mode="assign">
    <divide>
      <name>size</name>
      <name>pixelsizefixupfactor</name>
    </divide>
  </edit>
</match>

Previously the last edit was generating:

Fontconfig warning: "/home/behdad/.local/etc/fonts/conf.d/00-scale-bitmap-fonts.conf", line 29: saw unknown, expected number
2012-12-30 19:08:42 -06:00
Behdad Esfahbod 51b0044648 Allow target="font/pattern/default" in <name> elements
Based on idea from Raimund Steger.

For example, one can do something like this:

<match target="font">
  <test name="scalable" compare="eq">
    <bool>false</bool>
  </test>
  <edit name="pixelsizefixupfactor" mode="assign">
    <divide>
      <name target="pattern">pixelsize</name>
      <name target="font"   >pixelsize</name>
    </divide>
  </edit>
  <edit name="matrix" mode="assign">
    <times>
      <name>matrix</name>
      <matrix>
        <name>pixelsizefixupfactor</name> <double>0</double>
        <double>0</double> <name>pixelsizefixupfactor</name>
       </matrix>
    </times>
  </edit>
</match>

Part of work to make bitmap font scaling possible.  See thread
discussion:

http://lists.freedesktop.org/archives/fontconfig/2012-December/004498.html
2012-12-30 19:01:23 -06:00
Behdad Esfahbod d7e1965aa0 Remove memory accounting and reporting
That belongs in tools like cairo/util/malloc-stat.so
2012-12-29 23:12:07 -05:00
Behdad Esfahbod d823bb3cad Fixup from 4f6767470f 2012-12-29 22:57:53 -05:00
Behdad Esfahbod eb9ffac7e5 Fix more warnings 2012-12-29 22:56:14 -05:00
Behdad Esfahbod 1404af312a Fix warning 2012-12-29 22:55:36 -05:00
Behdad Esfahbod dd69d96e06 Fix sign-compare warnings 2012-12-29 22:47:49 -05:00
Behdad Esfahbod 4ad3a73691 Fix more warnings 2012-12-29 22:37:19 -05:00
Behdad Esfahbod 83d8019011 Fix unused-parameter warnings 2012-12-29 22:32:56 -05:00
Behdad Esfahbod 24cdcf52ab Fix compiler warnings 2012-12-29 22:24:24 -05:00
Behdad Esfahbod 4f6767470f Parse matrices of expressions
Previously a <matrix> element could only accept four <double> literals.
It now accepts full expressions, which can in turn poke into the
pattern, do math, etc.
2012-12-29 21:39:06 -05:00
Behdad Esfahbod 927dd3ddb5 Fix typo
Ouch, this has been wrong since 2004...  I guess no one uses <patelt>
stuff.
2012-12-29 20:14:07 -05:00
Akira TAGOH 9ce36f4bbe Check the system font to be initialized
config->fonts is an array and checking if config->fonts is a null
will not be useful.
2012-12-11 18:53:57 +09:00
Akira TAGOH 58040349e8 Fix a memory leak 2012-12-11 12:38:42 +09:00
Akira TAGOH 5ea3118ad6 Fix a typo that accessing to the out of array 2012-12-11 12:35:02 +09:00
Akira TAGOH cef2b50c66 clean up
ret won't be -1 if HAVE_STRUCT_DIRENT_D_TYPE isn't defined.
2012-12-11 12:30:05 +09:00
Akira TAGOH 608c5b590b Remove the duplicate null-check 2012-12-10 10:54:47 +09:00
Akira TAGOH e7954674eb Fix the wrong estimation for the memory usage information in fontconfig 2012-12-07 19:09:36 +09:00
Akira TAGOH 959442bca1 Fix a typo 2012-12-06 19:49:05 +09:00
Akira TAGOH 9231545c6b Do not show the deprecation warning if it is a symlink 2012-12-05 18:13:25 +09:00
Akira TAGOH 3d3629f86a Fix a potability issue about stdint.h 2012-11-27 18:25:11 +09:00
Akira TAGOH c20ac78b01 Bug 57114 - regression on FcFontMatch with namelang
After 7587d1c99d applied, family,
style, and fullname is localized against current locale or lang
if any though, the string in other languages were dropped from
the pattern. this caused unexpected mismatch on the target="font"
rules.

This fix adds other strings at the end of the list.
2012-11-15 16:37:32 +09:00
Akira TAGOH 8890f94438 Fix wrongly squashing for the network path on Win32.
Patch from Diego Santa Cruz
2012-10-09 11:03:03 +09:00
Akira TAGOH 535e0a37d6 Bug 54138 - X_OK permission is invalid for win32 access(..) calls
X_OK checking was added back in 8ae1e3d5dc
which was removed due to the same reason in
238489030a.
apparently the test case in Bug#18934 still works without it.
so I'm removing it again to get this working on Windows.
2012-08-31 12:39:38 +09:00
Akira TAGOH 375cdbce9d Bug 53585 - Two highly-visible typos in src/fcxml.c 2012-08-16 20:33:12 +09:00
Akira TAGOH da9400212d Fix a build fail with gcc 2.95, not supporting the flexible array members. 2012-07-09 14:46:51 +09:00
Marius Tolzmann e5a59eac90 Fix warning about deprecated, non-existent config includes
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 8: reading configurations from ~/.fonts.conf.d is deprecated.

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.

Be polite and do not issue the warning if deprecated config includes
(e.g. ~/.fonts.conf.d and/or ~/.fonts.conf) do not exist.
2012-06-22 13:58:46 +09:00
Marius Tolzmann 3a5e9bc75d Fix newline in warning about deprecated config includes 2012-06-22 13:57:13 +09:00
Akira TAGOH 4353df754f clean up the lock file properly on even hardlink-not-supported filesystem. 2012-06-18 10:52:21 +09:00
Akira TAGOH 997a64a67b Fix the fail of make install with --disable-shared on Win32 2012-06-14 11:27:31 +09:00
Akira TAGOH cd280f6532 Fix a build fail on MINGW 2012-06-13 20:01:30 +09:00
Akira TAGOH b447fc5d52 Bug 50835 - Deprecate FC_GLOBAL_ADVANCE
FC_GLOBAL_ADVANCE is deprecated. this flag is simply ignored on
freetype 2.4.5 or later.
2012-06-11 23:28:55 +09:00
Mark Brand 0b20bd0281 fix building for WIN32
8c255fb185 moved some code out of switch
but did not declare 'buffer'. Also, replacing the "break" with
"goto bail" neglected the WIN32 specific code.
2012-06-11 20:13:02 +09:00
Akira TAGOH cf70eaa3bf Bug 50525 - superfluous whitespace in the style 2012-06-08 19:41:59 +09:00
Akira TAGOH f4103bf708 fcdefault: Add the lang object at FcConfigSubstituteWithPat() only when kind is FcMatchPattern 2012-06-08 19:17:57 +09:00
Akira TAGOH 07e52eeb09 fcdefault: no need to set FC_LANG in FcDefaultSubstitute() anymore 2012-06-08 15:54:48 +09:00
Akira TAGOH 550fd49d4f Add the default language to the pattern prior to do build the substitution
the default language is referred from the FC_LANG environment variable
or the current locale
2012-06-08 15:48:30 +09:00
Akira TAGOH 2261a64ce1 fcdefault: fallback if the environment variables are empty
try to fallback if FC_LANG, LC_ALL, LC_CTYPE and LANG is empty
2012-06-08 15:47:52 +09:00
Akira TAGOH bbc8fb5ba7 Bug 32853 - Export API to get the default language
Add a new API FcGetDefaultLangs() to export the string sets of the default
languages.
2012-06-08 15:18:30 +09:00
Akira TAGOH 1b692d8ab9 Fix the wrong estimation for the memory usage information in fontconfig 2012-06-01 19:06:17 +09:00
Akira TAGOH 5254a6630f Fix a typo and polish the previous change 2012-05-31 13:07:29 +09:00
Akira TAGOH 4a741e9a0a Fix the build fail on Solaris
It's introduced by 0ac6c98294.
Use lstat() and S_ISDIR() to check if it's the directory or not
if there are no d_type in struct dirent.
2012-05-30 18:30:49 +09:00
Mikhail Gusarov 0ac6c98294 Fix cache aging for fonts on FAT filesystem under Linux
Windows does not update mtime of directory on FAT filesystem when
file is added to it or removed from it. Fontconfig uses mtime of
directory to check cache file aging and hence fails to detect
newly added or recently removed files.

This changeset detects FAT filesystem (currently implemented for
Linux) and adds generating checksum of directory entries instead
of using mtime which guarantees proper cache rebuild.

For non-FAT filesystems this patch adds single syscall per directory
which is negligeable overhead.

This fixes bug https://bugs.freedesktop.org/show_bug.cgi?id=25535

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2012-05-28 16:46:04 +09:00
Akira TAGOH dc2da23e69 Move statfs/statvfs wrapper to fcstat.c and add a test for the mtime broken fs
just rework to share the efforts between FcIsFsMmapSafe() and FcIsFsMtimeBroken().
2012-05-28 16:46:01 +09:00