fontconfig merge requestshttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests2024-03-11T12:21:55Zhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/314Fix invalid escape character \s2024-03-11T12:21:55ZDan YeawFix invalid escape character \sChanges the strings to raw strings so that the \ character is treated as a string literal.Changes the strings to raw strings so that the \ character is treated as a string literal.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/311meson: fix config relocation on Windows2024-02-22T02:19:26ZChristoph Reitermeson: fix config relocation on WindowsThe config relocation code in fccfg.c is guarded by DLL_EXPORT, but
that was never set in the meson port, unlike with autotools. Also
dllexport was only set for msvc.
Unify things to set FcPublic and DLL_EXPORT when building a shared
li...The config relocation code in fccfg.c is guarded by DLL_EXPORT, but
that was never set in the meson port, unlike with autotools. Also
dllexport was only set for msvc.
Unify things to set FcPublic and DLL_EXPORT when building a shared
library on Windows, for all compilers.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/310Store a direct pointer to elts in FcPattern2024-03-20T12:06:04Z小田喜陽彦Store a direct pointer to elts in FcPatternPattern elts are either allocated in a contiguous region whose head is a
FcPattern, or allocated separately. A reference to pattern elts is
held as an offset to the associated FcPattern. When pattern elts are
allocated separately, LeakSa...Pattern elts are either allocated in a contiguous region whose head is a
FcPattern, or allocated separately. A reference to pattern elts is
held as an offset to the associated FcPattern. When pattern elts are
allocated separately, LeakSanitizer cannot understand this reference
because it's not a normal pointer, and reports false leaks. Such false
reports are very noisy when applying LeakSanitizer to an application
that uses Fontconfig.
Store a direct pointer to elts instead of its relative offset in
FcPattern so that developers can apply LeakSanitizer to their
applications without being bothered by false reports. There are actually
more places that operate on direct pointers of elts instead of relative
offsets so this change also simplifies the code.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/304Draft: Modernize docs toolchain2023-12-31T14:43:06ZJan TojnarDraft: Modernize docs toolchainI wanted to switch fontconfig NixOS package over to Meson build system but we do not have docbook-utils so I could not build the docs. I could package them but they are dead (not even a [working website](https://src.fedoraproject.org/rpm...I wanted to switch fontconfig NixOS package over to Meson build system but we do not have docbook-utils so I could not build the docs. I could package them but they are dead (not even a [working website](https://src.fedoraproject.org/rpms/docbook-utils)) and appear to only support deprecated SGML syntax (DocBook 5 is XML only) so I did not bother. Instead I tried to use `xsltproc`, which is at least maintained (the XSLT 2.0 version of docbook-xsl stylesheets is pretty dead too but at least it has a working git repo).
The produced directory trees and, manpages and PDF outputs look mostly comparable to the previous ones.
Caveats:
- No TXT output (maybe there is some stylesheet for that but I did not look too hard, at worst, we could use pandoc)
- The pdf output depends on `fop`, which uses `openjdk`, which depends on `fontconfig` so bootstrapping might be annoying.
- Did not touch autotools yet.
- `fonts.conf(5)` is now the canonical manpage, not `fonts-conf(5)`, keep the latter as alias.
- HTML docs filenames are now case sensitive.
Not sure if this is a direction we want to go. Maybe porting to some more maintained alternative would be better but no docs toolchains are as well maintained as they would deserve and often bring huge number of extra dependencies.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/294Fix build issue on MinGW2023-09-19T09:11:15ZAkira TAGOHFix build issue on MinGWFixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/384Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/384Akira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/291Avoid __declspec(dllexport) for MSVC static build2023-08-15T14:08:28ZDmitry BelyAvoid __declspec(dllexport) for MSVC static buildhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/283Fix build issues on MSYS22023-07-21T04:21:32ZNirbheek Chauhannirbheek.chauhan@gmail.comFix build issues on MSYS2```
meson: Always use posix path, even on Windows
Fix build error when using MSYS2 and building inside C:\Users
FAILED: subprojects/fontconfig/test/test_bz89617.exe.p/test-bz89617.c.obj
"cc" [...] "-DSRCDIR=\"C:\\Users\\Administrator\\...```
meson: Always use posix path, even on Windows
Fix build error when using MSYS2 and building inside C:\Users
FAILED: subprojects/fontconfig/test/test_bz89617.exe.p/test-bz89617.c.obj
"cc" [...] "-DSRCDIR=\"C:\\Users\\Administrator\\runner\\builds\\nirbheek\\gstreamer\\subprojects\\fontconfig\\test\"" [...] ../subprojects/fontconfig/test/test-bz89617.c
../subprojects/fontconfig/test/test-bz89617.c: In function 'main':
../subprojects/fontconfig/test/test-bz89617.c:33:76: error: incomplete universal character name \U
33 | if (!FcConfigAppFontAddFile (config, (const FcChar8 *)SRCDIR "/4x6.pcf") ||
| ^
../subprojects/fontconfig/test/test-bz89617.c:33:76: warning: unknown escape sequence: '\A'
../subprojects/fontconfig/test/test-bz89617.c:33:76: warning: unknown escape sequence: '\g'
../subprojects/fontconfig/test/test-bz89617.c:33:76: warning: unknown escape sequence: '\s'
```
```
meson: Always write utf-8 files with LF newlines
Otherwise, MSYS2 gperf chokes on the CRLF newlines translated by
`open()`, even though we explicitly write out `\n`
[1/48] Generating src/fcobjshash.h with a custom command
FAILED: src/fcobjshash.h
"C:\msys64\usr\bin\gperf.EXE" "--pic" "-m" "100" "src/fcobjshash.gperf" "--output-file" "src/fcobjshash.h"
src/fcobjshash.gperf:17: warning: junk after %% is ignored
src/fcobjshash.gperf:2: warning: junk after %} is ignored
src/fcobjshash.gperf:3: junk after declaration
ninja: build stopped: subcommand failed.
```https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/281Provide FC_WIDTH_* constants as float2023-12-19T19:43:02ZAkira TAGOHProvide FC_WIDTH_* constants as floatfollow OpenType spec.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/354follow OpenType spec.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/354Akira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/276Meson: Fix build with clang-cl by using cc.preprocess()2023-06-06T11:50:58ZXavier Claessensxclaesse@gmail.comMeson: Fix build with clang-cl by using cc.preprocess()Fontconfig currently hardcode a few supported compilers to preprocess
gperf file. That hack is no needed since Meson 0.64.0 which added
support to preprocess files.
Also use fs.copyfile() to avoid deprecation warnings.Fontconfig currently hardcode a few supported compilers to preprocess
gperf file. That hack is no needed since Meson 0.64.0 which added
support to preprocess files.
Also use fs.copyfile() to avoid deprecation warnings.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/265Add integration with OpenType VF `ital` and `slnt` axes2023-03-07T15:42:28Zmsizanoen1Add integration with OpenType VF `ital` and `slnt` axesMap the `FC_SLANT` setting to either the `ital` or `slnt` axis depending
on what is available in the font. This allows client applications with
`FC_FONT_VARIATIONS` support to specify italic or oblique font
variations through fontconfig....Map the `FC_SLANT` setting to either the `ital` or `slnt` axis depending
on what is available in the font. This allows client applications with
`FC_FONT_VARIATIONS` support to specify italic or oblique font
variations through fontconfig.
This also introduce a new setting called `FC_SLANT_ANGLE` which is
mapped directly to the value of the `slnt` axis when available. This
allows the user to select which slant angle to be used for oblique
variations.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/253Make byteReverse hidden2023-01-16T09:24:10ZandheMake byteReverse hiddenWhen building on big-endian systems, the byteReverse symbol becomes an
exported symbol of the library. This seems like it's not intended,
specially since there are no symbol on little-endian systems
(where byteReverse is just an empty de...When building on big-endian systems, the byteReverse symbol becomes an
exported symbol of the library. This seems like it's not intended,
specially since there are no symbol on little-endian systems
(where byteReverse is just an empty define).
src/fcmd5.h already includes src/fcint.h which has a FcPrivate define to
hide symbols (when possible) that is already widely used, so use that.
(fontconfig/fcprivate.h defines FC_ATTRIBUTE_VISIBILITY_HIDDEN but it
seems basically unused.)
On debian package builds (on big-endian archs) this extra unexpected
symbol gets caught:
```
[...]
dh_makeshlibs -plibfontconfig1 -V"libfontconfig1 (>= 2.13)" --add-udeb="fontconfig-udeb" -- -c4
dpkg-gensymbols: error: some new symbols appeared in the symbols file: see diff output below
dpkg-gensymbols: warning: debian/libfontconfig1/DEBIAN/symbols doesn't match completely debian/libfontconfig1.symbols
--- a/debian/libfontconfig1.symbols (libfontconfig1_2.14.1-2_sparc64)
+++ b/debian/libfontconfig1.symbols 2023-01-05 14:08:46.386909057 +0000
@@ -237,5 +237,6 @@
FcWeightFromOpenTypeDouble@Base 2.13.0
FcWeightToOpenType@Base 2.12.6
FcWeightToOpenTypeDouble@Base 2.13.0
+ byteReverse@Base 2.14.1-2
default_langs@Base 2.12.6
other_types@Base 2.12.6
dh_makeshlibs: error: failing due to earlier errors
make[1]: *** [debian/rules:16: override_dh_makeshlibs] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:10: binary-arch] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned exit status 2
```https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/242Enable run-test.sh on meson2023-07-15T07:47:09ZAkira TAGOHEnable run-test.sh on mesonFix run-test.sh script which wrongly assume the current path.
That was the reason why it didn't work on meson.Fix run-test.sh script which wrongly assume the current path.
That was the reason why it didn't work on meson.Akira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/231fix undefined behavior in FcSerializeResize2022-10-05T14:23:57ZMitchell Hashimotofix undefined behavior in FcSerializeResizeCaught with `clang` `-fsanitize-trap=undefined`
`FcInitConfigAndLoad` or any other codepath that leads into `FcSerializeResize` would crash on this due to UB (if `-fsanitize-trap` is set).Caught with `clang` `-fsanitize-trap=undefined`
`FcInitConfigAndLoad` or any other codepath that leads into `FcSerializeResize` would crash on this due to UB (if `-fsanitize-trap` is set).https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/228fontconfig-user.sgml: clarify that version is a fixed-point 16.16 number2022-04-27T08:44:43ZMathnerd314fontconfig-user.sgml: clarify that version is a fixed-point 16.16 numberhttps://docs.microsoft.com/en-us/typography/opentype/spec/head says that fontRevision is a "Fixed" number, in particular a 16.16 fixed-point number, representable as a 32-bit integer.
Although the 32-bit integer format is convenient, th...https://docs.microsoft.com/en-us/typography/opentype/spec/head says that fontRevision is a "Fixed" number, in particular a 16.16 fixed-point number, representable as a 32-bit integer.
Although the 32-bit integer format is convenient, the documentation should be clear that it's a fixed-point number and explain how to convert version numbers such as 2.008. Here I made a minimal change; I did not check if fontVersion is mentioned in other places.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/227Update .gitlab-ci.yml2022-04-22T11:11:18ZAkira TAGOHUpdate .gitlab-ci.ymlAkira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/206Add support for libxml2 backend in meson build2022-04-12T08:08:57ZFrancesco PrettoAdd support for libxml2 backend in meson buildCurrently the meson build, differently than the autotools
one, doesn't support libxml2 as the xml parser backend.
The commit adds it in form of a 'libxml2' boolean
option that when enabled searches for libxml2 first.
It is not a meson 'f...Currently the meson build, differently than the autotools
one, doesn't support libxml2 as the xml parser backend.
The commit adds it in form of a 'libxml2' boolean
option that when enabled searches for libxml2 first.
It is not a meson 'feature' because features can get
enabled/disabled as a whole, and this does not fit
well with an optional dependency.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/194conf.d: Provide family descriptions and substitutions for MS fonts2022-04-23T14:48:53ZKevin Degelingconf.d: Provide family descriptions and substitutions for MS fontsMain issue: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/292Main issue: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/292https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/178fcobjs: Remove duplicate function prototypes2021-10-19T15:54:07ZNirbheek Chauhannirbheek.chauhan@gmail.comfcobjs: Remove duplicate function prototypesThese are already defined in `fcobjsghash.h` which is generated from
`fcobjshash.gperf`. This has been working fine because we were detecting
the len of `FC_GPERF_SIZE_T`, but it's incorrect in some cases, such as
on Windows, and then we...These are already defined in `fcobjsghash.h` which is generated from
`fcobjshash.gperf`. This has been working fine because we were detecting
the len of `FC_GPERF_SIZE_T`, but it's incorrect in some cases, such as
on Windows, and then we get build errors like:
```
In file included from ../src/fcobjs.c:33:
src/fcobjshash.gperf:28:1: error: conflicting types for 'FcObjectTypeHash'
"aspect",FC_ASPECT_OBJECT
^~~~~~~~~~~~~~~~
../src/fcobjs.c:28:1: note: previous declaration of 'FcObjectTypeHash' was here
FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len);
^~~~~~~~~~~~~~~~
In file included from ../src/fcobjs.c:33:
src/fcobjshash.gperf:192:1: error: conflicting types for 'FcObjectTypeLookup'
../src/fcobjs.c:31:1: note: previous declaration of 'FcObjectTypeLookup' was here
FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len);
^~~~~~~~~~~~~~~~~~
```
We don't actually need to auto-detect this value in configure if we
let the header define it.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/177Clarify documentation of what prgname does2021-04-26T04:53:13ZJadeClarify documentation of what prgname doesPreviously it was unclear if it was, for instance, the X11 class or
other property like that, or a path.Previously it was unclear if it was, for instance, the X11 class or
other property like that, or a path.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/166Merge similar mutex code2021-01-26T11:27:55ZJacko DirksMerge similar mutex codeThe files `src/fccache.c` and `src/fccfg.c` contained very similar mutex-related code. This code is now placed in `src/fcmutex.c`.
I also concluded that the additional call to `FcRandom` during mutex creation was not required, and there...The files `src/fccache.c` and `src/fccfg.c` contained very similar mutex-related code. This code is now placed in `src/fcmutex.c`.
I also concluded that the additional call to `FcRandom` during mutex creation was not required, and therefore I removed it. This simplified the logic, so that a `goto` could be replaced with a do-while.
Finally, there is the `FC_MUTEX_IMPL_INIT` macro. This macro can be used to initialize a mutex compile-time, but unfortunately not on Windows. This macro was unused and is therefore removed.