Commit Graph

121 Commits

Author SHA1 Message Date
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 58040349e8 Fix a memory leak 2012-12-11 12:38:42 +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 9231545c6b Do not show the deprecation warning if it is a symlink 2012-12-05 18:13:25 +09:00
Akira TAGOH 375cdbce9d Bug 53585 - Two highly-visible typos in src/fcxml.c 2012-08-16 20:33:12 +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 cd280f6532 Fix a build fail on MINGW 2012-06-13 20:01:30 +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 1b692d8ab9 Fix the wrong estimation for the memory usage information in fontconfig 2012-06-01 19:06:17 +09:00
Akira TAGOH 2837c63876 Bug 33644 - Fontconfig doesn't match correctly in <test>
Warn if the multiple values is set to <test>, including the case of
in <alias> because the behavior isn't intuitive since so many users
is asking for a help to get things working for their expectation.

Use multiple <match>s or <alias>es for OR operator and
multiple <test>s for AND operator.
2012-05-25 13:11:25 +09:00
Akira TAGOH 8c255fb185 Bug 20411 - fontconfig doesn't match FreeDesktop directories specs
Allows reading configuration files, fonts and cache files from
the directories where the XDG Base Directory Specification defines.

the old directories are still in the configuration files for
the backward compatibility.
2012-05-18 11:12:50 +09:00
Akira TAGOH bc4517d8e5 Bug 19128 - Handling whitespace in aliases
Add a new attribute `ignore-blanks' to <test>.
When this is set to "true", any blanks in the string will be ignored
on comparison.  This takes effects for compare="eq" or "not_eq" only.

Also changed the behavior of the comparison on <alias> too.
2012-05-14 12:06:12 +09:00
Akira TAGOH 470e92c9db Bug 27526 - Compatibility fix for old windows sytems
Patch from Gianluigi Tiesi
2012-04-12 14:01:25 +09:00
Akira TAGOH ddefa5021f Bug 22862 - <alias> ignores <match> <test>s
Allow to use the test elements in the alias element.
2012-04-06 11:14:42 +09:00
Akira TAGOH d8dcff7b96 Bug 17832 - Memory leaks due to FcStrStaticName use for external patterns
Use the reference-counted strings instead of the static strings

Patch from Karl Tomlinson
2012-03-28 13:42:01 +09:00
Behdad Esfahbod 43bf659eed Skip <range> elements with begin > end 2010-12-28 02:55:31 -06:00
Akira TAGOH 3c862aad9f Add editing langset feature.
The syntax to add any langset to the langset table looks like:

<match target="scan">
    <test name="family">
        <string>Buggy Sans</string>
    </test>
    <edit name="lang" mode="assign">
        <plus>
            <name>lang</name>
            <langset>
                <string>zh-cn</string>
                <string>zh-tw</string>
            </langset>
        </plus>
    </edit>
</match>

To remove any langset from the langset table:

<match target="scan">
    <test name="family">
        <string>Buggy Sans</string>
    </test>
    <edit name="lang" mode="assign">
        <minus>
            <name>lang</name>
            <langset>
                <string>ja</string>
            </langset>
        </minus>
    </edit>
</match>
2010-12-09 11:40:08 +09:00
Akira TAGOH d975cdda78 Add the range support in blank element 2010-12-09 11:36:26 +09:00
Akira TAGOH 857b7efe1e Add charset editing feature.
The syntax to add any characters to the charset table looks like:

<match target="scan">
    <test name="family">
        <string>Buggy Sans</string>
    </test>
    <edit name="charset" mode="assign">
        <plus>
            <name>charset</name>
            <charset>
                <int>0x3220</int>    <!-- PARENTHESIZED IDEOGRAPH ONE -->
            </charset>
        </plus>
    </edit>
</match>

To remove any characters from the charset table:

<match target="scan">
    <test name="family">
        <string>Buggy Sans</string>
    </test>
    <edit name="charset" mode="assign">
        <minus>
            <name>charset</name>
            <charset>
                <int>0x06CC</int>    <!-- ARABIC LETTER FARSI YEH -->
                <int>0x06D2</int>    <!-- ARABIC LETTER YEH BARREE -->
                <int>0x06D3</int>    <!-- ARABIC LETTER YEH BARREE WITH HAMZA ABOVE -->
            </charset>
        </minus>
    </edit>
</match>

You could also use the range element for convenience:

...
            <charset>
                <int>0x06CC</int>    <!-- ARABIC LETTER FARSI YEH -->
                <range>
                    <int>0x06D2</int>    <!-- ARABIC LETTER YEH BARREE -->
                    <int>0x06D3</int>    <!-- ARABIC LETTER YEH BARREE WITH HAMZA ABOVE -->
                </range>
            </charset>
...
2010-12-09 11:09:24 +09:00
Behdad Esfahbod 5aaf466d38 Cleanup copyright notices to replace "Keith Packard" with "the author(s)" 2010-11-10 16:45:42 -05:00
Behdad Esfahbod d0d1f3904c More whitespace 2010-04-12 12:10:05 -04:00
Behdad Esfahbod 2b0f3f1128 Whitespace 2010-04-12 11:52:09 -04:00
Behdad Esfahbod dffcb2a083 [xml] Remove unused code 2009-11-16 17:46:18 -05:00
Behdad Esfahbod f33a23133e Bug 22037 - No Fonts installed on a default install on Windows Server 2003
Make it easy to install on older Windows
2009-08-21 13:41:41 -04:00
Tor Lillqvist 8b1ceef0b7 Use multi-byte codepage aware string function on Windows
The East Asian double-byte codepages have characters with backslash as
the second byte, so we must use _mbsrchr() instead of strrchr() when
looking at pathnames in the system codepage.
2009-08-13 18:19:56 -04:00
Tor Lillqvist d15678127a Fix heap corruption on Windows in FcEndElement()
Must not call FcStrFree() on a value returned by
FcStrBufDoneStatic(). In the Windows code don't bother with dynamic
allocation, just use a local buffer.
2009-08-13 18:17:33 -04:00
Tor Lillqvist a1b6e34a9a Fix MinGW compilation
Need to define _WIN32_WINNT as 0x0500 to get declaration for
GetSystemWindowsDirectory().
2009-08-13 18:13:04 -04:00
Behdad Esfahbod 327fc9d183 Use GetSystemWindowsDirectory() instead of GetWindowsDirectory() (#22037) 2009-07-21 15:41:47 -04:00
Behdad Esfahbod 16e55c7c85 Fix leak with string VStack objects 2009-07-20 16:30:12 -04:00
Behdad Esfahbod 3164ac7622 [xml] Intern more strings 2009-06-24 13:52:13 -04:00
Behdad Esfahbod 390c05e64a [xml] Allocate FcExpr's in a pool in FcConfig
Reduces number of malloc's for FcExprs from hundreds into single digits.
2009-06-24 13:52:13 -04:00
Behdad Esfahbod 398d436441 [xml] Mark more symbols static 2009-06-24 13:52:13 -04:00
Behdad Esfahbod a96ecbfa20 [xml] Centralize FcExpr allocation
To be improved, using a central pool.
2009-06-24 13:52:13 -04:00
Behdad Esfahbod 5aebb3e299 Remove unused prototypes and function 2009-06-24 13:52:12 -04:00
Behdad Esfahbod 3074a73b41 Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all files 2009-03-13 17:59:28 -04:00
Behdad Esfahbod de69ee14d3 [fcxml.c] Embed a static 64-byte attr buffer in FcPStack
Reduces number of mallocs called from FcConfigSaveAttr in my small test
from 160 down to 6.
2009-03-12 13:14:38 -04:00
Behdad Esfahbod 39861b7d9c [fcxml] Embed 64 static FcVStack objects in FcConfigParse
This reduces the number of mallocs called from FcVStackPush from
over 800 down to zero.
2009-03-12 13:14:38 -04:00
Behdad Esfahbod 1d7b47da9d [fcxml] Embed 8 static FcPStack objects in FcConfigParse
This reduces the number of mallocs called from FcPStackPush from
over 900 down to zero.
2009-03-12 13:14:38 -04:00
Behdad Esfahbod 532d8a1dbc [fcxml] Don't allocate attr array if there are no attributes
Reduces number of mallocs from FcConfigSaveAttr() in my small test
from over 900 down to 157.
2009-03-12 13:14:37 -04:00
Behdad Esfahbod 3ed70071cd [fcstr,fcxml] Don't copy FcStrBuf contents when we would free it soon
We can simply NUL-terminate the buffer and use it.  Reduces number of
mallocs called from FcStrBufDone in my small test from 631 down to 66.
2009-03-12 13:14:37 -04:00
Behdad Esfahbod 1cdf7efb22 [win32] Expand "APPSHAREFONTDIR" to ../share/fonts relative to binary location
Proposed by Diego Santa Cruz.
2009-02-15 13:40:24 -08:00
Harald Fernengel fe8e8a1dd7 Don't use variables named 'bool' (bug #18851) 2009-02-13 16:54:01 -08:00
Behdad Esfahbod 799691c901 Don't leak FcValues string loaded through fcxml.c (#17661)
Patch from Caolan McNamara.
2009-02-13 16:54:00 -08:00
Behdad Esfahbod 317b849215 Replace RCS Id tags with the file name 2009-02-13 16:53:55 -08:00
Behdad Esfahbod e04afe83de Avoid C99ism in Win32 code (#16651) 2009-02-13 16:53:54 -08:00
Keith Packard 8ade236923 Ignore empty <dir></dir> elements
An empty element would cause every file starting with the current
directory to be scanned, probably not what the user wanted.
2008-05-24 17:14:24 -07:00
Dennis Schridde 6d65081e35 Proper config path for static libraries in win32
Since fontconfig didn't have special handling for paths in static Windows
libraries, I've created a patch which should fix this.

Basically it does this:
fccfg.c:
If fontconfig_path was uninitialised it tries to get the directory the exe is
in and uses a fonts/ dir inside that.
fcxml.c:
In case the fonts.conf lists a <dir>CUSTOMFONTDIR</dir>, it searches for a
fonts/ directory where the exe is located.
2008-05-03 19:45:31 -07:00