Commit Graph

79 Commits

Author SHA1 Message Date
Khaled Hosny e0eb855462 Detect standalone CFF fonts for FC_FONT_WRAPPER
FreeType will return CFF for both SFNT fonts with CFF table as well as
standalone CFF fonts, but applications might want to support the former
and not the later, so now FC_FONT_WRAPPER makes the distinction more
clear.
2023-08-24 14:11:26 +03:00
Khaled Hosny f614ec4d60 Add FC_FONT_WRAPPER
Currently detects only SFNT wrappers:
- WOFF: if it is FreeType says it is an SFNT font the file starts with wOFF tag
- WOFF2: the same but tag is wOF2
- SFNT: for any other SFNT font (which helps distinguishing standalone
  CFF fonts from CFF in SFNT aka OTF)

Fixes #375
2023-08-08 18:17:10 +03:00
Akira TAGOH 7e2a1b2577 Add more docs about selectfont
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/363
2023-06-12 19:59:53 +09:00
Akira TAGOH fb726e86bd Fix a typo in scalable property
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/365
2023-06-12 19:33:41 +09:00
Akira TAGOH ff037052bc Fix a typo 2023-05-30 19:00:02 +09:00
Akira TAGOH e4987ef114 Remove the problematic language from code and doc 2023-05-29 22:13:23 +09:00
Akira TAGOH f0612537cb Add namedinstance property
This change allows applications to detect if a font
is a variable font and a named-instance.
If they are, namedinstance property is set to true,
otherwise false.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/362
2023-05-25 20:12:31 +09:00
Akira TAGOH 1751596768 Add missing property descriptions
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/360
2023-05-17 14:18:52 +09:00
Akira TAGOH 963ec653a3 Change the order of the properties to the order of fontconfig cache format 2023-05-17 14:11:22 +09:00
Akira TAGOH 43baa9a884 Adujst indentation between programlisting in fontconfig-user.sgml
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/344
2023-01-27 14:25:11 +09:00
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