fontconfig issueshttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues2018-08-20T21:43:17Zhttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/5FcFontList &quot;contain&quot; semantics unproductive2018-08-20T21:43:17ZBugzilla Migration UserFcFontList "contain" semantics unproductive## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#107246)](https://bugs.freedesktop.org/show_bug.cgi?id=107246)**
## Description
If I want to list only fonts that have fontformat=TrueType or fontformat=CFF, currently I can't:
behdad:~ 0$ fc-list :fontformat=truetype,cff
Returns empty.
This is because FcFontList interprets that as returning fonts that have both fontformat=truetype AND fontformat=cff. Code:
/*
* Font must have a containing value for every value in the pattern
*/
static FcBool
FcListValueListMatchAny (FcValueListPtr patOrig, /* pattern */
FcValueListPtr fntOrig) /* font */
{
FcValueListPtr pat, fnt;
for (pat = patOrig; pat != NULL; pat = FcValueListNext(pat))
{
for (fnt = fntOrig; fnt != NULL; fnt = FcValueListNext(fnt))
{
/*
* make sure the font 'contains' the pattern.
* (OpListing is OpContains except for strings
* where it requires an exact match)
*/
if (FcConfigCompareValue (&fnt->value,
FC_OP (FcOpListing, FcOpFlagIgnoreBlanks),
&pat->value))
break;
}
if (fnt == NULL)
return FcFalse;
}
return FcTrue;
}
I cannot imagine any scenario that this semantic is useful. I suggest we flip it from an AND to an OR.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/46Postscript name matching issues2018-10-08T10:01:14ZBugzilla Migration UserPostscript name matching issues## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#107242)](https://bugs.freedesktop.org/show_bug.cgi?id=107242)**
## Description
Dominik and I are looking at postscriptname matching in Chrome, and I found a couple issues with it.
1. The code seems to want to ignore space and dash as delimiters:
""static double
FcComparePostScript (const FcValue *v1, const FcValue *v2, FcValue *bestValue)
{
const FcChar8 *v1_string = FcValueString (v1);
const FcChar8 *v2_string = FcValueString (v2);
int n;
size_t len;
*bestValue = FcValueCanonicalize (v2);
if (FcToLower (*v1_string) != FcToLower (*v2_string) &&
↦ *v1_string != ' ' && *v2_string != ' ')
↦ return 1.0;
n = FcStrMatchIgnoreCaseAndDelims (v1_string, v2_string, (const FcChar8 *)" -");
len = strlen ((const char *)v1_string);
return (double)(len - n) / (double)len;
}
""
But in actual testing I don't see dash ignored. NOT ignoring dash is actually correct and desired behavior. I just don't understand why it's not ignored by the code currently.
Inside FcStrCaseWalkerNext(), delims are not checked when fulfilling request from w->read:
""
static FcChar8
FcStrCaseWalkerNext (FcCaseWalker *w, const char *delims)
{
FcChar8↦ r;
if (w->read)
{
↦ if ((r = *w->read++))
↦ return r;
↦ w->read = 0;
}
do
{
↦ r = *w->src++;
} while (r != 0 && delims && strchr (delims, r));
if ((r & 0xc0) == 0xc0)
↦ return FcStrCaseWalkerLong (w, r);
if ('A' <= r && r <= 'Z')
r = r - 'A' + 'a';
return r;
}
""
Ie, "if ((r = *w->read++))" needs to also check delims...5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/27FC_FULLNAME wrong for variable-font instances2018-08-20T21:44:51ZBugzilla Migration UserFC_FULLNAME wrong for variable-font instances## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#107165)](https://bugs.freedesktop.org/show_bug.cgi?id=107165)**
## Description
We don't override it. We should create fullname from family and style. It's hard to do it right with regard to different languages...
For varfonts, currently fullname gets set to the fullname of the default style. We should probably just copy family to fullname for varfonts.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/63RBGA Order options for moden panels (Pentile, RGBG, OLED)2018-08-20T21:48:53ZBugzilla Migration UserRBGA Order options for moden panels (Pentile, RGBG, OLED)## Submitted by Redsandro
Assigned to **fon..@..op.org**
**[Link to original bug (#106219)](https://bugs.freedesktop.org/show_bug.cgi?id=106219)**
## Description
Created attachment 139058
Subpixel pattern for Lenovo OLED screens
* Cinnamon version 3.4.6
* Distribution - Mint 18.3 x64
There are no RBGA Order options for moden panels (Pentile, RGBG, OLED etc) in Font Settings.
Raised here: https://github.com/linuxmint/Cinnamon/issues/7107
Redirected to freedesktop/fontconfig.
Lenovo Yoga Carbon OLED, for example, has pixels that could be simplified as:
RB
GB
**Attachment 139058**, "Subpixel pattern for Lenovo OLED screens":
![oled_pattern](/uploads/6150843b277ff305e8656ef5a0bcf51f/oled_pattern.png)5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/103Merge some optimisation works by Michal Srb?2019-05-04T08:15:05ZBugzilla Migration UserMerge some optimisation works by Michal Srb?## Submitted by Mingcong Bai
Assigned to **fon..@..op.org**
**[Link to original bug (#105102)](https://bugs.freedesktop.org/show_bug.cgi?id=105102)**
## Description
First described in his paper ¹ to optimise various fontconfig algorithms, his work ² has proven to be beneficial especially with LibreOffice. With current 2.12.6 it is practically impossible to scroll through the font listing when a full set of Noto and Noto CJK fonts are installed, scrolling can cause the UI to lock up for more than a second which practically destroys the user experience.
With patches generated from his work - applied upon 2.12.6, this issue has gone away. I was trying to test https://bugs.freedesktop.org/show_bug.cgi?id=105085 with 2.12.92, however, these patches would no longer apply to the newest code, as extensive API changes were made - it would be a shame to waste all these optimisation works...
--------
¹ https://www.theseus.fi/bitstream/handle/10024/124694/Srb_Michal.pdf?sequence=1
² https://github.com/michalsrb/fontconfig
Version: 2.125. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/100Add way to FcNameUnparse to specify weak binding?2018-08-20T21:52:32ZBugzilla Migration UserAdd way to FcNameUnparse to specify weak binding?## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#103727)](https://bugs.freedesktop.org/show_bug.cgi?id=103727)**
## Description
Would be nice. Right now there's no way to generate patterns with weak bindings from command-line.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/40run-test271.sh failing2018-08-20T21:45:48ZBugzilla Migration Userrun-test271.sh failing## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#102025)](https://bugs.freedesktop.org/show_bug.cgi?id=102025)**
## Description
I'm getting out:
Fixed:pixelsize=16
Fixed:pixelsize=6
=
Fixed:pixelsize=16
Fixed:pixelsize=6
=
Fixed:pixelsize=16
Fixed:pixelsize=6
whereas expected is:
Misc Fixed:pixelsize=6
Sony Fixed:pixelsize=16
=
Misc Fixed:pixelsize=6
Sony Fixed:pixelsize=16
=
Misc Fixed:pixelsize=6
Sony Fixed:pixelsize=165. Library2. Needs Informationbugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/60Make fontconfig cache relocatable2018-08-20T21:48:10ZBugzilla Migration UserMake fontconfig cache relocatable## Submitted by Akira TAGOH `@tagoh`
Assigned to **Akira TAGOH `@tagoh`**
**[Link to original bug (#101889)](https://bugs.freedesktop.org/show_bug.cgi?id=101889)**
## Description
Current fontconfig caches are supposed to be matched one-by-one to fonts. when fonts has been moved somewhere or doing bind-mounts fonts directories somewhere else would causes rebuilding caches and can't share it on them (which is the main target this time).
This also affects the startup time for applications and caches should supports relocation without rebuilding.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/85Make it build with MSVC2018-08-20T21:50:57ZBugzilla Migration UserMake it build with MSVC## Submitted by Ignacio Casal Quinteiro
Assigned to **fon..@..op.org**
**[Link to original bug (#97237)](https://bugs.freedesktop.org/show_bug.cgi?id=97237)**
## Description
On our downstream gtk-win32 project we are maintaining a patch for quite a while already to make it build with MSVC. It would be great if somebody could take the interesting parts from it and push it upstream:
https://github.com/wingtk/gtk-win32/blob/master/fontconfig/fontconfig.patch5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/33Support ISO 14496-28 Composite Font Representation2018-08-20T21:45:18ZBugzilla Migration UserSupport ISO 14496-28 Composite Font Representation## Submitted by Sascha Brawer
Assigned to **fon..@..op.org**
**[Link to original bug (#96693)](https://bugs.freedesktop.org/show_bug.cgi?id=96693)**
## Description
Could fontconfig support the Composite Font Representation of ISO 14496-28?
https://blogs.adobe.com/CCJKType/2012/04/cfr.html
At Google, we’re considering to release CFR files for grouping the myriad of Noto fonts into a few families such as "Noto Sans", "Noto Serif", and "Noto Mono". The total number of glyphs exceeds 64K, so we cannot just ship Noto Sans etc. as one gigantic OpenType file. Instead, we need a mechanism for declaring a virtual font. CFR has the advantage of being standardized. However, as of June 2016, Apple is the only platform that implements CFR. But perhaps fontconfig could follow Apple in that regard? Anyhow, here’s a draft CFR file for Noto Sans, which might help to illustrate the CFR syntax:
https://github.com/googlei18n/noto-fonts/issues/707#issuecomment-224503236
For downloading the official specification document (+errata) from ISO, search for "14496-28" on this page:
http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html
— Sascha Brawer, sascha@brawer.ch / sascha@google.com5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/22Add desktopname object like prgname2018-08-20T21:44:32ZBugzilla Migration UserAdd desktopname object like prgname## Submitted by Akira TAGOH `@tagoh`
Assigned to **fon..@..op.org**
**[Link to original bug (#96650)](https://bugs.freedesktop.org/show_bug.cgi?id=96650)**
## Description
That might be useful if someone wants to have different behavior in the configuration against current desktop session.
The usecase is e.g. the default hinting in GNOME is hintslight and KDE seems hintmedium. one may wants to have different default hinting for non native-desktop applications among desktops.
the desktopname object may be compared to $XDG_CURRENT_DESKTOP.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/77Code obfuscation results in memory leaks reported by Valgrind, AddressSanitizer2018-08-20T21:50:25ZBugzilla Migration UserCode obfuscation results in memory leaks reported by Valgrind, AddressSanitizer## Submitted by Zoltán Böszörményi
Assigned to **fon..@..op.org**
**[Link to original bug (#96535)](https://bugs.freedesktop.org/show_bug.cgi?id=96535)**
## Description
Fontconfig uses pointer arithmetics to compute the distance from an object base pointer to a member structure and the result is stored in intptr_t type members.
This causes reported memory leaks in fontconfig in applications compiled with GCC's AddressSanitizer and Valgrind, too.
The fact that the size of intptr_t always equals to the size of a pointer makes this whole thing look like code obfuscation.
It also slows down the code slightly. Pointer arithmetics and storing the result is always slower than just storing the pointer value.
The amount of reported memory leaks in AddressSanitizer is so much that it makes genuine debugging hard, like searching for a needle in a haystack.
Please, use real pointers instead of intptr_t.
Version: 2.115. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/49[patch] Allow fontconfig to use 3 components in locales2018-08-20T21:46:25ZBugzilla Migration User[patch] Allow fontconfig to use 3 components in locales## Submitted by Koop Mast
Assigned to **fon..@..op.org**
**[Link to original bug (#92776)](https://bugs.freedesktop.org/show_bug.cgi?id=92776)**
## Description
Created attachment 119343
Support 3 component locales
Linux only supports locales with 2 components while POSIX supports
locales with 3 components.
DragonFly and FreeBSD both follow POSIX, which causes fontconfig to
give the following warning:
% env LC_CTYPE=sr_Cyrl_RS.UTF-8 leafpad
Fontconfig warning: ignoring sr_Cyrl_RS.UTF-8: not a valid region tag
For more information about the POSIX documentation:
http://tools.ietf.org/html/bcp47
Chapter 2.1.1 goes over formatting and Appendix-A has more examples.
**Patch 119343**, "Support 3 component locales":
[0001-Support-3-component-locales.patch](/uploads/a49842028169b9604a3b4bf52b4284a1/0001-Support-3-component-locales.patch)
Version: 2.115. Library2. Needs Informationbugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/61hard dependency on scandir2018-08-20T21:48:42ZBugzilla Migration Userhard dependency on scandir## Submitted by Riccardo Mottola
Assigned to **fon..@..op.org**
**[Link to original bug (#91088)](https://bugs.freedesktop.org/show_bug.cgi?id=91088)**
## Description
Hi,
building on solaris 9 (and older) fails because the existing scandir() implementatino is inside the UCB layer (additional -I and -L flags needed) but it is also slightly different in the parameters (direct vs. dirent). I couldn't get configure to pass, I don't even know about the code. Perhaps it can be done, but it is worth?
https://answers.yahoo.com/question/index?qid=1006050301563
Some other odd OSs apparently do not have scandir() available at all.
I propose to have a fallback version supplied to make fontconfig more portable.
E.g. look at this patch NetBSD applies in its portable package:
http://pkgsrc.se/files.php?messageId=20140715144835.1658296@cvs.netbsd.org
Instead of enabling for just one OS, perhaps it should be enabled it configure fails the test.
Thanks, Riccardo5. Library2. Needs Informationbugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/25RFE: Accessor functions to the structure members2018-08-20T21:44:42ZBugzilla Migration UserRFE: Accessor functions to the structure members## Submitted by Akira TAGOH `@tagoh`
Assigned to **fon..@..op.org**
**[Link to original bug (#90923)](https://bugs.freedesktop.org/show_bug.cgi?id=90923)**
## Description
fontconfig should disallow the direct access to the structure members to applications. it keeps ABI compatibility in general and avoid unnecessary crashes against unexpected pointer access say.
maybe targeting on fontconfig3.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/98Config format (and api?) to define virtual families2018-08-20T21:52:25ZBugzilla Migration UserConfig format (and api?) to define virtual families## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#90428)](https://bugs.freedesktop.org/show_bug.cgi?id=90428)**
## Description
Right now we recognize sans-serif, serif, monospace, fantasy, and cursive but user has to know that. Would be nice to allow defining those formally, and let user define more.
That would be useful for a font-manager kind of scenario, where one can define new virtual families and add multiple fonts as a stack to it.
The latter can be done using existing configuration facilities (mostly), so the part missing is just making it appear in FcFontList() output.
No idea what the config / API for this should look like.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/73Preserve binding when preparing patterns2018-08-20T21:49:46ZBugzilla Migration UserPreserve binding when preparing patterns## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#90330)](https://bugs.freedesktop.org/show_bug.cgi?id=90330)**
## Description
In FcFontRenderPrepare(), matching values are always added with binding=strong. If we change that to retain the binding of the matched value and also add API to get binding, then we can have a recommended way to determine whether font fallback happened.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/82Language bindings...2018-08-20T21:50:44ZBugzilla Migration UserLanguage bindings...## Submitted by Behdad Esfahbod
Assigned to **Akira TAGOH `@tagoh`**
**[Link to original bug (#90274)](https://bugs.freedesktop.org/show_bug.cgi?id=90274)**
## Description
Perhaps using gobject-introspection, like we do in HarfBuzz...
G-I sucks for non-GObject projects though; a SWIG or even ctypes alternative might be easier. Not sure. Just filing the request for now.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/8Provide CMap information for CID-keyed fonts2018-08-20T21:43:33ZBugzilla Migration UserProvide CMap information for CID-keyed fonts## Submitted by Akira TAGOH `@tagoh`
Assigned to **fon..@..op.org**
**[Link to original bug (#90161)](https://bugs.freedesktop.org/show_bug.cgi?id=90161)**
## Description
just an idea to make more convenience for PostScript and PDF.5. Librarybugzillahttps://gitlab.freedesktop.org/fontconfig/fontconfig/issues/65Warn if config is wrong2018-08-20T21:49:03ZBugzilla Migration UserWarn if config is wrong## Submitted by Behdad Esfahbod
Assigned to **fon..@..op.org**
**[Link to original bug (#82582)](https://bugs.freedesktop.org/show_bug.cgi?id=82582)**
## Description
I know we don't do full xml validation against the DTD, but at least, we should be able to catch many nonsensical configs, for example, someone trying this:
`<match target="font">`
`<or>`
`<test name="family" compare="contains">`
`<string>`MYingHeiB5HK`</string>`
`</test>`
`<test name="family" compare="contains">`
`<string>`MYingHeiGB18030`</string>`
`</test>`
`<test name="family" compare="contains">`
`<string>`MSung GB18030`</string>`
`</test>`
`<test name="family" compare="contains">`
`<string>`MSung B5HK`</string>`
`</test>`
`</or>`
<!-- Turn on light auto-hint -->
<!-- Turn off sub-pixel anti-aliasing -->
`<edit name="hinting" mode="assign">``<bool>`true`</bool>``</edit>`
`<edit name="autohint" mode="assign">``<bool>`true`</bool>``</edit>`
`<edit name="hintstyle" mode="assign">``<const>`hintslight`</const>``</edit>`
`<edit name="antialias" mode="assign">``<bool>`true`</bool>``</edit>`
`<edit name="rgba" mode="assign">``<const>`none`</const>``</edit>`
`</match>`
The problem is, `<or>` doesn't go in `<match>`, and `<test>` doesn't go in `<or>`. It just edits the pattern unconditionally!
I *think* the correct way to write it is:
`<match target="font">`
`<test name="family" compare="contains">`
`<or>`
`<string>`MYingHeiB5HK`</string>`
`<string>`MYingHeiGB18030`</string>`
`<string>`MSung GB18030`</string>`
`<string>`MSung B5HK`</string>`
`</or>`
`</test>`
I hear in the past (with 2.7.x), this used to work:
`<match target="font">`
`<test name="family" compare="contains">`
`<string>`MYingHeiB5HK`</string>`
`<string>`MYingHeiGB18030`</string>`
`<string>`MSung GB18030`</string>`
`<string>`MSung B5HK`</string>`
`</test>`
<!-- Turn on light auto-hint -->
<!-- Turn off sub-pixel anti-aliasing -->
`<edit name="hinting" mode="assign">``<bool>`true`</bool>``</edit>`
`<edit name="autohint" mode="assign">``<bool>`true`</bool>``</edit>`
`<edit name="hintstyle" mode="assign">``<const>`hintslight`</const>``</edit>`
`<edit name="antialias" mode="assign">``<bool>`true`</bool>``</edit>`
`<edit name="rgba" mode="assign">``<const>`none`</const>``</edit>`
`</match>`
but with 2.11.x started warning about multiple strings in `<test>`...5. Librarybugzilla