Commit Graph

69 Commits

Author SHA1 Message Date
Ondrej Balaz da1e3f35e6 Expand ~ in glob
Allow ~ home directory expansion in acceptfont and rejectfont globs.

Fixes: #347
2023-01-25 06:14:54 +09:00
Akira TAGOH 27a21ccef0 Convert tabs to spaces
This fixes broken layout on pdf.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/343
2022-12-13 16:05:41 +09:00
Alan Coopersmith d863f67789 Bump the cache version to 8 in doc/fontconfig-user.sgml
Makes docs match code changes from commit 5d84745e72

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-12 04:13:05 +00:00
ratijas d243bb3f88 Fix closing tag bracket typo in doc/fontconfig-user.sgml 2020-12-17 06:03:40 +00:00
Akira TAGOH 68d021b634 Add FC_ORDER property into cache
"fontversion" used to be modified to sort out fonts as a technique.
But that lost the original purpose to do the version control between
releases.

This change adds the dedicated property into the cache.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/226
2020-05-25 18:22:55 +09:00
Nicolas Mailhot 9c46ef4aac Use an URN for DTD ID
XML tools interpret “fonts.dtd” as a relative path.

Unfortunately, that can not work now that the configuration is spread over
multiple system-dependant directories, without a common relative path to this
file. And, an absolute path can not be defined in a system-independant way.
System independance is a requirement to share config files between systems.

Therefore, replace the broken relative path by a formal URN, that will work the
same way on all systems, without network access.

This makes the DTD registerable with commands like:
$ xmlcatalog --noout --add system \
                           "urn:fontconfig:fonts.dtd" \
                           "file:///usr/share/xml/fontconfig/fonts.dtd" \
                           /etc/xml/catalog

That enables easy config file checking:
$ xmllint --loaddtd ${config_file} >/dev/null
2020-03-28 15:01:35 +01:00
Akira TAGOH 80047ed8e8 Add FC_FONT_HAS_HINT property to see if font has hinting or not.
This may helps to enable autohint only when font doesn't have any hinting
2019-07-29 10:19:26 +00:00
Akira TAGOH 4ff52ffb52 Update doc for salt 2019-04-03 12:02:09 +00:00
Akira TAGOH def1d00036 Add reset-dirs element
This element removes all of fonts directories where added by
dir elements. it is useful to override fonts dirs from system
to their own dirs only.
2019-04-03 12:02:09 +00:00
Akira TAGOH a563a1802e Add new element remap-dir instead of extending dir element 2019-04-03 12:02:09 +00:00
Keith Packard c4324f54ee Replace UUID file mechanism with per-directory 'map' attribute [v2]
The UUID files would be placed in each font directory to provide the
unique cache name, independent of path, for that directory. The UUID
files are undesireable for a couple of reasons:

 1) They must be placed in the font directories to be useful. This
    requires modifying the font directories themselves, introducing
    potential visible timestamp changes when running multiple
    applications, and makes the cache processing inconsistent between
    applications with permission to write to the font directories and
    applications without such permission.

 2) The UUID contents were generated randomly, which makes the font
    cache not reproducible across multiple runs.

One proposed fix for 2) is to make the UUID dependent on the font
directory path, but once we do that, we can simply use the font
directory path itself as the key as the original MD5-based font cache
naming mechanism did.

The goal of the UUID file mechanism was to fix startup time of
flatpaks; as the font path names inside the flatpak did not match the
font path names in the base system, the font cache would need to be
reconstructed the first time the flatpak was launched.

The new mechanism for doing this is to allow each '<dir>' element in
the configuration include a 'map' attribute. When looking for a cache
file for a particular directory, if the directory name starts with the
contents of the <dir> element, that portion of the name will be
replaced with the value of the 'map' attribute.

Outside of the flatpak, nothing need change -- fontconfig will build
cache files using real directory names.

Inside the flatpak, the custom fonts.conf file will now include
mappings such as this:

	<dir map="/usr/share/fonts">/run/host/fonts</dir>

When scanning the directory /run/host/fonts/ttf, fontconfig will
use the name /usr/share/fonts/ttf as the source for building the cache
file name.

The existing FC_FILE replacement code used for the UUID-based
implementation continues to correctly adapt font path names seen by
applications.

v2:
	Leave FcDirCacheCreateUUID stub around to avoid removing
	public API function.

	Document 'map' attribute of <dir> element in
	fontconfig-user.sgml

	Suggested-by: Akira TAGOH <akira@tagoh.org>

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Akira TAGOH 2bd559f75d Add doc for description element and update fonts.dtd
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/133
2018-11-15 20:55:36 +09:00
Akira TAGOH 942db25fbc Update docs for 1aa8b700 2018-10-04 08:07:07 +00:00
Chris Lamb f098adac54 Ensure cache checksums are deterministic
Whilst working on the Reproducible Builds[0] effort, we noticed that
fontconfig generates unreproducible cache files.

This is due to fc-cache uses the modification timestamps of each
directory in the "checksum" and "checksum_nano" members of the _FcCache
struct. This is so that it can identify which cache files are valid
and/or require regeneration.

This patch changes the behaviour of the checksum calculations to prefer
the value of the SOURCE_DATE_EPOCH[1] environment variable over the
directory's own mtime. This variable can then be exported by build
systems to ensure reproducible output.

If SOURCE_DATE_EPOCH is not set or is newer than the mtime of the
directory, the existing behaviour is unchanged.

This work was sponsored by Tails[2].

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/specs/source-date-epoch/
 [2] https://tails.boum.org/
2018-05-16 16:06:46 +09:00
Tom Anderson 730deada8c Add FONTCONFIG_SYSROOT environment variable 2018-05-05 17:57:21 +09:00
Akira TAGOH c78afa9066 Fix typo in doc
https://bugs.freedesktop.org/show_bug.cgi?id=106128
2018-04-19 11:45:45 +09:00
Akira TAGOH 3e4198674d Add the description of FC_LANG envvar to the doc 2017-03-24 13:11:08 +09:00
Alan Coopersmith 0db7552e00 Correct cache version info in doc/fontconfig-user.sgml
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-08-15 12:06:58 +09:00
Akira TAGOH 10a57edd07 Add one more debugging option to see transformation on font-matching
just setting FC_MATCH=3 shows a lot of information and hard to keep on track for informamtion
which is really necessary to see. to use this more effectively, added FC_DBG_MATCH_FILTER to
see for what one really want to see. it takes a comma-separated-list of object names.
If you want to see family name only, try like this:

FC_DBG_MATCH_FILTER=family FC_DEBUG=4096 fc-match

debugging output will be filtered out and see family only in the result.
2015-06-08 17:39:25 +09:00
Akira TAGOH 55ff841927 Make FC_SCALE deprecated
Use FC_MATRIX instead.

https://bugs.freedesktop.org/show_bug.cgi?id=90257
2015-05-12 14:49:12 +09:00
Akira TAGOH b3fc08bc95 Fix a typo in fontconfig-user.sgml
https://bugs.freedesktop.org/show_bug.cgi?id=90105
2015-04-22 11:17:04 +09:00
Akira TAGOH 07be485a0a Fix a typo for the latest cache version 2015-04-20 10:49:21 +09:00
Akira TAGOH 78ed920e2b Fix a typo in docs 2015-01-19 19:48:50 +09:00
Akira TAGOH 4c60fabf66 Add missing docs 2015-01-06 16:37:18 +09:00
Behdad Esfahbod bf9df5ada7 Change DemiLight from 65 to 55
Such that Regular is closer to Medium than to DemiLight
2014-07-25 18:07:59 -04:00
Behdad Esfahbod be6506ca04 Add FC_WEIGHT_DEMILIGHT
Part of https://bugs.freedesktop.org/show_bug.cgi?id=81453
Also hooks up FC_WEIGHT_BOOK to fcfreetype.c.
2014-07-25 16:24:26 -04:00
Akira TAGOH 7e44a0b5a8 Bug 68955 - Deprecate / remove FC_RASTERIZER 2013-09-10 17:45:11 +09:00
Akira TAGOH 20191810d1 Bug 23757 - Add mode="delete" to <edit>
Add two edit mode, "delete" and "delete_all".
what values are being deleted depends on <test> as documented.
if the target object is same to what is tested, matching value there
will be deleted. otherwise all of values in the object will be deleted.
so this would means both edit mode will not take any expressions.

e.g.

Given that the testing is always true here, the following rules:

  <match>
    <test name="foo" compare="eq">
      <string>bar</string>
    </test>
    <edit name="foo" mode="delete"/>
  </match>

will removes "bar" string from "foo" object. and:

  <match>
    <test name="foo" compare="eq">
      <string>foo</string>
    </test>
    <edit name="bar" mode="delete"/>
  </match>

will removes all of values in "bar" object.
2013-02-01 12:56:14 +09:00
Behdad Esfahbod ec5ca08c80 Bug 59379 - FC_PRGNAME
Can be used for per-application configuration.
2013-01-15 20:46:45 -06:00
Akira TAGOH 3f84695104 Bug 50497 - RFE: Add OpenType feature tags support
Add FC_FONT_FEATURES to store the feature tags to be enabled.
2013-01-15 19:40:26 -06:00
Behdad Esfahbod 424cfa1684 Adjust docs for recent changes 2012-12-31 20:00:17 -06:00
Akira TAGOH 769306665c Bug 18726 - RFE: help write locale-specific tests
Add an example matching rule for the language specific
2012-06-22 14:30:56 +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
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 794fb0bd6a Correct the example
Enclose the string with <string> in <test>
2012-05-21 13:37:54 +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 7d65f9f514 Bug 39278 - make usage of mmap optional
Stop using mmap() if the cache file is stored on NFS.
also added FONTCONFIG_USE_MMAP environment variable to enforce the use of
or not the use of mmap(2) regardless of what the filesystem the cache files
are stored on.
2012-04-25 16:38:01 +09:00
Akira TAGOH d3e3f4a46d doc: Add contains and not_contains operators and elements 2012-03-30 18:09:14 +09:00
Akira TAGOH 765b7b32d8 [doc] Update for cachedir.
<cache> element is now obsoletes and no longer used. get rid of it
from the doc and add <cachedir> instead.
2012-03-12 19:02:27 +09:00
Akira TAGOH e8bdc6df2e [doc] Update the path for cache files and the version. 2012-03-12 17:58:00 +09:00
Brad Hards 7baa20c759 Documentation fixes 2011-03-11 19:43:42 -03:00
Akira TAGOH fa269cf812 add some documents 2010-12-09 11:57:24 +09:00
Akira TAGOH 51e352a1bd add some document for range and charset. 2010-12-09 11:32:26 +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 21384990ff [doc] Add ~/fonts.conf.d to user docs 2009-07-27 14:50:44 -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 77c0d8bce8 Add fc-query (#13019) 2009-02-13 16:53:56 -08:00
Sylvain Pasche 53aec11107 Fontconfig options for freetype sub-pixel filter configuration
David Turner has modified FreeType to be able to render sub-pixel decimated
glyphs using different methods of filtering. Fontconfig needs new
configurables to support selecting these new filtering options. A patch
follows that would correspond to one available for Cairo in bug 10301.
2008-05-03 19:33:45 -07:00
Peter Breitenlohner b1aa20098f Use <literal> instead of <sgmltag> when documenting fonts.conf. Bug 8935. 2006-12-02 14:28:03 -08:00