fontconfig issueshttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues2019-12-08T10:51:51Zhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/38Font subfamilies merged2019-12-08T10:51:51ZBugzilla Migration UserFont subfamilies merged## Submitted by Sam Liddicott
Assigned to **fon..@..op.org**
**[Link to original bug (#13416)](https://bugs.freedesktop.org/show_bug.cgi?id=13416)**
## Description
I have the full set of adobe helvetica including Helvetica Inserat...## Submitted by Sam Liddicott
Assigned to **fon..@..op.org**
**[Link to original bug (#13416)](https://bugs.freedesktop.org/show_bug.cgi?id=13416)**
## Description
I have the full set of adobe helvetica including Helvetica Inserat and Helvetica Neue.
fontconfig seems to be merging these into one happy family called "Helvetica" regardless of variant (Neue or Inserat) or style.
As I'm using fontconfig 2.4.2 on Ubuntu I have also reported this on Launchpad:
https://bugs.launchpad.net/ubuntu/+source/fontconfig/+bug/24764
where there seems to be a similar problem that was bug #4924 here, apparently fixed. (So maybe it's a different problem).
fc-list | grep -i helvetica
seems to be missing out most of the Inserat / Neue / fractions variants and just using the name "Helvetica"
Helvetica:style=Fractions Bold
Helvetica:style=Ultra Compressed
Helvetica:style=.Black Oblique
Helvetica:style=Rounded Bold Condensed Oblique
Helvetica:style=Narrow Bold
Helvetica:style=Black
Helvetica:style=Narrow Bold Italic
Helvetica:style=Condensed Light
Helvetica:style=Oblique
Helvetica:style=Fractions
Helvetica:style=Condensed Medium
Helvetica:style=Narrow
Helvetica:style=Compressed
Helvetica:style=Rounded Black
Helvetica:style=Rounded Bold Condensed
Helvetica:style=Condensed Bold Oblique
Helvetica:style=Light
Helvetica Inserat:style=Roman
Helvetica:style=Light Oblique
Helvetica:style=Narrow Italic
Helvetica:style=Rounded Black Oblique
Helvetica:style=Bold
Helvetica:style=Condensed Bold
Helvetica Neue:style=Regular
Helvetica:style=Regular
Helvetica:style=Condensed Black Oblique
Helvetica:style=Condensed Light Oblique
Helvetica:style=Condensed Oblique
Helvetica:style=Condensed Black
Helvetica:style=Bold Oblique
Helvetica:style=Extra Compressed
Helvetica:style=Rounded Bold Oblique
Helvetica:style=Rounded Bold
I also notice that Gnome Font Viewer gets it wrong.
HLB__*.PFB is called "Helvetica Neue, Regular" by Gnome Font Viewer which is wrong, the B after HL in HLB means BOLD.
Kfontview correctly calls it "Helvetica Neue, Bold"
fontforge also knows that the font is bold.
firefox chooses the wrong Helvetica
openoffice can't find any Helvetica at all
Note that fc-list did not show any bold versions of Helvetica Neue
# FC_DEBUG=384 fc-cache -f
shows:
Scanning file /usr/share/fonts/type1/dbam/hlb_____.pfb...
using FreeType family "Helvetica Neue"
using FreeType style "Regular"
Type1 weight Bold maps to 200
Style Regular maps to width -1
Style Regular maps to slant -1
Style Regular maps to decorative 0
...
So it knows after a fashion that this is Bold, but still calls it style "Regular"
and then:
Scanning file /usr/share/fonts/type1/dbam/hlbc____.pfb...
using FreeType family "Helvetica Neue"
using FreeType style "Regular"
Type1 weight Bold maps to 200
Style Regular maps to width -1
Style Regular maps to slant -1
Style Regular maps to decorative 0
the hlbc_*.pfb is bold condensed, but even kfontview did not "know" this.
Inkscape shows the fonts available as:
Hevetica: Regular, Black, Compressed, Condensed Black, Condensed Light, Extra Compressed, Fractions, Light, Narrow, Rounded Black, Ultra Compressed, Condensed Medium, .Black Oblique, Condensed Black Oblique, Condensed Oblique, Light Oblique, Narrow Italic, Oblique, Rounded Black Oblique, Bold, Condensed Bold, Fractions Bold, Narrow Bold, Rounded Bold, Rounded Bold Condensed, Bold Oblique, Condensed Bold Oblique, Bold Oblique, Narrow Bold Italic, Rounded Bold Condensed Oblique, Rounded Bold Italic
(and shows the wrong face, e.g. i see a fractions face when Regular is selected)
Helvetica Inserat: Roman, Italic, Bold, Bold Italic
Helvetica Neue: Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular, Regular
Which clearly isn't right.
Version: 2.4https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/264font substitution2020-11-04T23:23:28Zjulien tayonfont substitutionI had a bug on orgmode website due to the "width/height" parameter in the CSS, so I thought, it is a CSS bug ?
Then, I talked to the dev, and realize it was not,
then, I found a bug similar to mine in firefox, so I thought it was a bug...I had a bug on orgmode website due to the "width/height" parameter in the CSS, so I thought, it is a CSS bug ?
Then, I talked to the dev, and realize it was not,
then, I found a bug similar to mine in firefox, so I thought it was a bug in firefox
https://bugzilla.mozilla.org/show_bug.cgi?id=1336049
Then, I decided to try andrei idea and check it.
Well, guess what, apparently there is a bug that appears in mozilla preventing me to see my dyslexic font when none of the fallback given for a font are installed (or so I imagine, because I don't understand the man pages of fc)
Not my nicest bash script but here is the gist of it
first of all no bug when trying to substitute and unknown font prior to the one I want
Hence font MUST be referenced for the bug to appear.
- then trying font substitution in firefox for all fonts declared in fc
- then looking witch one fail by comparing the screenshot from an headless firefox
- look which one are installed
- look which one are supposed to be used for substitution
- then try to see how much of the proposed fonts for substitution are existing on installation
On my OS (reported also on alpine hence the reason I fill the bug here and not on my distro)
I have 0 success for the proposal of subsitution when looking up for the failed fonts
**HOWTO reproduce**
1. create a profile with andika installed https://software.sil.org/andika/
2. open about:config and try to set the substiution proposed
```
user_pref("font.default.x-western", "Andika");
user_pref("font.name-list.serif.x-western","Andika");
```
3. close ALL your firefox
4. run this script
5. expect a "Point proven"
NB https://gist.github.com/jul/ac13585656499ec9b23a27bcc2ffb7bf
EDIT 180 font fails at home / 314 edited a bug on the fly
PPS I hate mardown
```
#!/usr/bin/bash
MIN_FF_OPT=" --headless "
FF="firefox $MIN_FF_OPT"
die() { echo "$@"; exit 0;}
fc-match Andika || die "le test va pas marcher"
echo "basically if I could create profile from scratch I would put only this"
cat <<EOF
user_pref("font.default.x-western", "Andika");
user_pref("font.name-list.serif.x-western","Andika");
EOF
SUCC=0
FAIL=0
RZ='\e[0m'
GR=${GR-'\e[92m'}
RD=${RD-'\e[91m'}
HL=${HL-'\e[1m'}
TOTAL=$( fc-list | cut -d ":" -f 2 | cut -d "," -f 1 | sed -e 's/^ //' | sort | uniq | wc -l )
OK() { SUCC=$(( SUCC + 1 )); echo -n "$@ :"; echo -e "${HL}${GR}OK${RZ} ($SUCC/$TOTAL)"; echo "$@" >> success.txt; }
KO() { FAIL=$(( FAIL + 1 )); echo -n "$@ :"; echo -e "${HL}${RD}KO${RZ} ($SUCC/$TOTAL)"; echo "$@" >> failture.txt; }
echo "what is the name of the profile for the test ?"
read -r PROFILE
FF="firefox -P $PROFILE $MIN_FF_OPT"
# edit
rm success.txt failture.txt
$FF --screenshot ref.png 'data:text/html,<body style="font-family: serif">test'
diff -q ref.png ref2.png && OK serif || KO serif
$FF --screenshot ref2.png "data:text/html,<body style=\"font-family: 'DejaVu Serif', serif\">test"
diff -q ref.png ref2.png && OK Dejavu Serif || KO dejavu serif
while IFS= read -r font
do
$FF --screenshot ref2.png "data:text/html,<body style=\"font-family: '$font', serif\">test" &> /dev/null
diff -q ref.png ref2.png &> /dev/null && OK "$font" || KO "$font"
done <<< "$( fc-list | cut -d ":" -f 2 | cut -d "," -f 1 | sed -e 's/^ //' | sort | uniq ) "
fc-list -b | perl -ane 'm!/([a-zA-Z]+)\-!; print "$1\n";' | sort | uniq > installed_fonts
while IFS= read -r font; do fc-match "$font"; done < failture.txt | cut -d ":" -f 1 > matched_fonts.txt
TOTAL=$( wc -l failture.txt | cut -d " " -f 1 )
SUCC=0
FAIL=0
while IFS= read -r font; do grep "$font" installed_fonts &> /dev/null && OK "$font" || KO "$font" ; done < matched_fonts.txt
[[ $SUCC == "0" ]] && echo -e "${HL}${RD}point proven if a font has no matched installed fonts in fc-match substitution fail${RZ}"
```
![res2](/uploads/820963a2996c9dde2f364ff03e8602fb/res2.png)
![res1](/uploads/020055406b6321fcf8af028d20493164/res1.png)[](url)https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/112Font update lets Opera and Vivaldi crash2018-09-19T10:28:48ZWalter BishopFont update lets Opera and Vivaldi crashA few days ago I updated my font cache because a game needed windows fonts. I followed the Arch Wiki to copy the W10 fonts and regenerated the fontconfig cache.
https://wiki.archlinux.org/index.php/Microsoft_fonts#Using_fonts_from_a_Win...A few days ago I updated my font cache because a game needed windows fonts. I followed the Arch Wiki to copy the W10 fonts and regenerated the fontconfig cache.
https://wiki.archlinux.org/index.php/Microsoft_fonts#Using_fonts_from_a_Windows_partition
When Opera or Vivaldi are started via the terminal I get the same output from both.
Vivali output https://8n1.org/13727/bb20
Opera output https://8n1.org/13728/3a56
The only difference is that Opera repeats the process four times, while Vivaldi stops after one try.
Chromium, the mother, is not affected. Just as Firefox or any other program I use regularly.
Arch Linux 4.18.7
Cinnamon 3.8.8
mesa 18.2https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/315Font weight limited with a variable font2022-02-21T09:33:06ZbarmadridFont weight limited with a variable fontI'm having an issue with one specific variable font [RobotoFlex](https://github.com/TypeNetwork/Roboto-Flex/tree/main/fonts). The font weight range available to me in Firefox and within Gnome shell, for example seems to be limited to onl...I'm having an issue with one specific variable font [RobotoFlex](https://github.com/TypeNetwork/Roboto-Flex/tree/main/fonts). The font weight range available to me in Firefox and within Gnome shell, for example seems to be limited to only Regular and Medium weights. Even if I choose Bold (in Gnome Tweaks or manually set websites display RobotoFlex using the Inspector tool and change the weight to Bold) it displays as Medium.
I had filed an [issue](https://github.com/TypeNetwork/Roboto-Flex/issues/145) with the font developer, but I was told that it might be a fontconfig issue.
Please let me know what other details you want me to provide.
```
$ FC_DEBUG=256 fc-query RobotoFlex\[GRAD,XOPQ,XTRA,YOPQ,YTAS,YTDE,YTFI,YTLC,YTUC,opsz,slnt,wdth,wght\].ttf
FC_DEBUG=256
found family (n 1 p 3 e 1 l 0x0409)RobotoFlex
found full (n 4 p 3 e 1 l 0x0409)RobotoFlex Regular
found style (n 2 p 3 e 1 l 0x0409) Regular
os2 weight class 400 multiplier 1 maps to weight 80
os2 width class 5 multiplier 1 maps to width 100
complex_ features in this font: otlayout:DFLT
Style Regular maps to slant -1
Style Regular maps to decorative 0
aa(0) ab(14) af(0)
ak(5) { 0186 0190 0254 025b 0329 }
am(264) an(0) ar(36) as(64)
ast(4) { 1e24 1e25 1e36 1e37 }
av(0) ay(0)
az-az(1) { 0131 }
az-ir(40) ba(0) be(0) ber-dz(14) ber-ma(32) bg(0) bh(68) bho(68) bi(0) bin(0)
bm(6) { 0186 0190 019d 0254 025b 0272 }
bn(63) bo(95) br(0) brx(82) bs(0) bua(0) byn(255) ca(0) ce(0) ch(0)
chm(4) { 04a4 04a5 04f8 04f9 }
chr(85) co(0)
crh(1) { 0131 }
cs(0) csb(0) cu(27) cv(0) cy(0) da(0) de(0) doi(85) dv(49) dz(95) ee(19) el(0) en(0) eo(0) es(0) et(0) eu(0) fa(40)
fat(5) { 0186 0190 0254 025b 0329 }
ff(8) { 0181 018a 019d 01b3 01b4 0253 0257 0272 }
fi(0) fil(0) fj(0) fo(0) fr(0) fur(0) fy(0) ga(14) gd(0) gez(218) gl(0) gn(0) gu(68) gv(0)
ha(8) { 0181 018a 0198 0199 01b3 01b4 0253 0257 }
haw(1) { 02bb }
he(27) hi(68) hne(68) ho(0) hr(0) hsb(0) ht(0) hu(0) hy(77)
hz(5) { 032f 1e12 1e13 1e4a 1e4b }
ia(0) id(0) ie(0) ig(0) ii(1165) ik(0) io(0) is(0) it(0) iu(161) ja(2314) jv(0) ka(33) kaa(0) kab(14) ki(0) kj(0) kk(0) kl(0) km(63) kn(70) ko(2442) kok(68)
kr(4) { 018e 01dd 024c 024d }
ks(33)
ku-am(4) { 051a 051b 051c 051d }
ku-iq(32) ku-ir(32) ku-tr(0) kum(0) kv(0) kw(0) kwm(0) ky(0) la(0) lah(27) lb(0) lez(0) lg(0) li(0)
ln(4) { 0186 0190 0254 025b }
lo(55) lt(0) lv(0) mai(68) mg(0) mh(0)
mi(2) { 1e34 1e35 }
mk(2) { 0400 0450 }
ml(68) mn-cn(130) mn-mn(0) mni(76) mo(0) mr(68) ms(0) mt(0) my(48) na(0) nb(0) nds(0) ne(72) ng(0) nl(0) nn(0) no(0) nqo(59) nr(0) nso(0) nv(0) ny(0) oc(0) om(0) or(68) os(0) ota(37) pa(63) pa-pk(27) pap-an(0) pap-aw(0) pl(0) ps-af(49) ps-pk(49) pt(0)
qu(1) { 02c8 }
quz(1) { 02c8 }
rm(0) rn(0) ro(0) ru(0) rw(0) sa(68)
sah(4) { 0494 0495 04a4 04a5 }
sat(70) sc(0)
sco(4) { 01b7 021c 021d 0292 }
sd(54) se(0) sel(0) sg(0) sh(0)
shs(1) { 0313 }
si(73) sid(281) sk(0) sl(0)
sm(1) { 02bb }
sma(0) smj(0) smn(0)
sms(8) { 01b7 01e4 01e5 01e8 01e9 01ee 01ef 0292 }
sn(0) so(0) sq(0) sr(0) ss(0) st(0) su(0) sv(0) sw(0) syr(45) ta(48) te(70)
tg(2) { 04e2 04e3 }
th(74) ti-er(255) ti-et(281) tig(221) tk(0) tl(0) tn(0)
to(1) { 02bb }
tr(1) { 0131 }
ts(0) tt(0)
tw(5) { 0186 0190 0254 025b 0329 }
ty(0) tyv(0) ug(33) uk(0) und-zmth(300) und-zsye(641) ur(27) uz(0) ve(10) vi(0) vo(0) vot(0) wa(0) wal(281) wen(0) wo(0) xh(0) yap(0) yi(27) yo(14) za(0) zh-cn(6763) zh-hk(1083) zh-mo(1083) zh-sg(6763) zh-tw(13063) zu(0)
found family (n 1 p 3 e 1 l 0x0409)RobotoFlex
os2 weight class 400 multiplier 1 maps to weight 80
os2 width class 5 multiplier 1 maps to width 100
complex_ features in this font: otlayout:DFLT
Pattern has 27 elts (size 32)
family: "RobotoFlex"(s)
familylang: "en"(s)
style: "Regular"(s)
stylelang: "en"(s)
fullname: "RobotoFlex Regular"(s)
fullnamelang: "en"(s)
slant: 0(i)(s)
weight: 80(f)(s)
width: 100(f)(s)
size: 14(f)(s)
foundry: "GOOG"(s)
file: "RobotoFlex[GRAD,XOPQ,XTRA,YOPQ,YTAS,YTDE,YTFI,YTLC,YTUC,opsz,slnt,wdth,wght].ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
charset:
0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
0001: ffffffff fffdffff ffffffff 7fffffff 00048000 00018003 00001ff0 fc000cc0
0002: 0fffffff 000f3c00 02000000 00000000 00000000 16000000 3f0002c0 00000000
0003: 08029fdf 000241d8 00000000 40300000 ffffd7f0 fffffffb 0080ffff 00000000
0004: fffffffe ffffffff fffeffff 00000000 3fcf0000 0fcffc0f 33cf8007 c00fc3c0
001e: 00000000 00000000 00000000 00000000 4000003f ffffffff ffffffff 03ffffff
0020: 77390000 060d0047 00040010 00100000 00000000 37363ada 00000000 00000000
0021: 00400000 00000044 00000000 00000000 00000000 00000000 00000000 00000000
0022: 02240040 00000000 00000100 00000031 00000000 00000000 00000000 00000000
0027: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000300
00f5: 0f03c000 0000333c 00000000 00000000 00000000 00000000 00000000 00000000
00fb: 0000001f 00000000 00000000 00000000 00000000 00000000 00000000 00000000
(s)
lang: aa|af|av|ay|ba|be|bg|bi|bin|br|bs|bua|ca|ce|ch|co|cs|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gn|gv|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|kv|kw|ky|la|lb|lez|lt|lv|mg|mh|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tk|tl|tn|ts|tt|tyv|uk|uz|vi|vo|vot|wa|wen|wo|xh|yap|zu|an|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|pap-an|pap-aw|rn|rw|sc|sg|sn|su|ty|za(s)
fontversion: 139985(i)(s)
capability: "otlayout:DFLT"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "RobotoFlex-Regular"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: False(s)
order: 0(i)(s)
Pattern has 22 elts (size 32)
family: "RobotoFlex"(s)
familylang: "en"(s)
slant: 0(i)(s)
weight: [0 215](s)
width: [25 151](s)
size: [8 144](s)
foundry: "GOOG"(s)
file: "RobotoFlex[GRAD,XOPQ,XTRA,YOPQ,YTAS,YTDE,YTFI,YTLC,YTUC,opsz,slnt,wdth,wght].ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
charset:
0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
0001: ffffffff fffdffff ffffffff 7fffffff 00048000 00018003 00001ff0 fc000cc0
0002: 0fffffff 000f3c00 02000000 00000000 00000000 16000000 3f0002c0 00000000
0003: 08029fdf 000241d8 00000000 40300000 ffffd7f0 fffffffb 0080ffff 00000000
0004: fffffffe ffffffff fffeffff 00000000 3fcf0000 0fcffc0f 33cf8007 c00fc3c0
001e: 00000000 00000000 00000000 00000000 4000003f ffffffff ffffffff 03ffffff
0020: 77390000 060d0047 00040010 00100000 00000000 37363ada 00000000 00000000
0021: 00400000 00000044 00000000 00000000 00000000 00000000 00000000 00000000
0022: 02240040 00000000 00000100 00000031 00000000 00000000 00000000 00000000
0027: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000300
00f5: 0f03c000 0000333c 00000000 00000000 00000000 00000000 00000000 00000000
00fb: 0000001f 00000000 00000000 00000000 00000000 00000000 00000000 00000000
(s)
lang: aa|af|av|ay|ba|be|bg|bi|bin|br|bs|bua|ca|ce|ch|co|cs|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gn|gv|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|kv|kw|ky|la|lb|lez|lt|lv|mg|mh|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tk|tl|tn|ts|tt|tyv|uk|uz|vi|vo|vot|wa|wen|wo|xh|yap|zu|an|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|pap-an|pap-aw|rn|rw|sc|sg|sn|su|ty|za(s)
fontversion: 139985(i)(s)
capability: "otlayout:DFLT"(s)
fontformat: "TrueType"(s)
decorative: False(s)
color: False(s)
symbol: False(s)
variable: True(s)
fonthashint: False(s)
order: 0(i)(s)
```https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/240Force font selection for a given character range2020-05-26T10:19:35ZRodrigo LourençoForce font selection for a given character rangeAs per [this answer on StackOverflow](https://stackoverflow.com/a/47614324/2052998), I have this snippet in my ~/.config/fontconfig/fonts.conf:
```xml
<match target="scan">
<test name="family" compare="not_eq">
<string>Sourc...As per [this answer on StackOverflow](https://stackoverflow.com/a/47614324/2052998), I have this snippet in my ~/.config/fontconfig/fonts.conf:
```xml
<match target="scan">
<test name="family" compare="not_eq">
<string>Source Han Serif</string>
</test>
<edit name="charset" mode="assign">
<minus>
<name>charset</name>
<charset>
<range>
<int>0x3040</int>
<int>0x309F</int>
</range>
</charset>
</minus>
</edit>
</match>
```
What I want is to always render hiragana using Source Han Serif unless a specific font is requested. If every font except Source Han Serif has the characters 0x3040-0x309F removed, then it should select that font whenever that character is requested, correct? However:
```
$ fc-match -s ":charset=3041" | grep -i source
SourceHanSans-Regular.ttc: "Source Han Sans" "Regular"
SourceSansVariable-Roman.otf: "Source Sans Variable" "Regular"
SourceSansVariable-Italic.otf: "Source Sans Variable" "Italic"
SourceCodePro-Regular.otf: "Source Code Pro" "Regular"
SourceSerifVariable-Roman.otf: "Source Serif Variable" "Regular"
```
Oddly enough, Han Serif it is not even there. But Han Sans should not be in there, since it does not have that character range, correct?
```
$ fc-match -v ":charset=3041" | grep -e family: -e charset: -e 0030:
family: "Source Han Sans"(s) "源ノ角ゴシック"(s)
charset:
0030: ffffffff ffffffff fffffffe ffffffff fe7fffff ffffffff ffffffff ffffffff
```
So why does it have those characters? I can see they are removed when scanning:
```
$ FC_DEBUG=$((1|2|4|8|16|32|64|128|256|1024|2048|4096)) fc-cache -r 2>&1
Scanning file /usr/share/fonts/adobe-source-han-sans/SourceHanSans-Regular.ttc...
FcConfigSubstitute Pattern has 25 elts (size 32)
family: "Source Han Sans"(s) "源ノ角ゴシック"(s)
[...]
charset:
[...]
0030: ffffffff ffffffff fffffffe ffffffff fe7fffff ffffffff ffffffff ffffffff
[...]
Rule Set: /home/rzl/.config/fontconfig/fonts.conf
FcConfigSubstitute test scan any family NotEqual "Source Han Serif"
Substitute Edit charset Assign charset Minus charset
Append list before [marker]
Append list after
[...]
0030: ffffffff ffffffff 00000000 00000000 00000000 ffffffff ffffffff ffffffff
[...]
(w)
FcConfigSubstitute editPattern has 25 elts (size 32)
family: "Source Han Sans"(s) "源ノ角ゴシック"(s)
[...]
charset:
[...]
0030: ffffffff ffffffff 00000000 00000000 00000000 ffffffff ffffffff ffffffff
[...]
(w)
[...]
Final font pattern:
Pattern has 25 elts (size 32)
family: "Source Han Sans"(s) "源ノ角ゴシック"(s)
familylang: "en"(s) "ja"(s)
style: "Regular"(s)
stylelang: "en"(s)
fullname: "Source Han Sans"(s) "源ノ角ゴシック"(s)
fullnamelang: "en"(s) "ja"(s)
slant: 0(i)(s)
weight: 80(f)(s)
width: 100(f)(s)
foundry: "ADBO"(s)
file: "/usr/share/fonts/adobe-source-han-sans/SourceHanSans-Regular.ttc"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
charset:
[...]
0030: ffffffff ffffffff 00000000 00000000 00000000 ffffffff ffffffff ffffffff
[...]
(w)
lang: aa|ay|bg|bi|bin|br|ch|da|de|en|es|eu|fj|fo|fur|fy|gd|gl|gn|gv|haw|ho|ia|ig|id|ie|io|is|it|ja|ki|ko|kum|lb|mg|nb|nds|nl|nn|no|nr|oc|om|os|pt|rm|ru|sel|sm|sma|smj|so|sq|ss|st|sv|sw|tl|to|ts|uz|vo|wa|xh|yap|zh-cn|zh-hk|zh-mo|zh-sg|zh-tw|zu|an|fil|ht|jv|kj|kwm|li|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
fontversion: 131137(i)(s)
capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:hang otlayout:hani otlayout:kana otlayout:latn"(s)
fontformat: "CFF"(s)
decorative: False(s)
postscriptname: "SourceHanSans-Regular"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: False(s)
```
Am I misunderstanding how this is supposed to work? I know I can force one single character to use a certain font thus:
```xml
<match target="pattern">
<test name="charset" compare="eq">
<charset>
<int>0x3040</int>
</charset>
</test>
<edit name="family" mode="prepend">
<string>Source Han Serif</string>
</edit>
</match>
```
But listing all characters in this way would not be fun, given that there is no "in" comparison, nor there seems to be a way to `or` tests. Is this the intended way to do it?https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/318frozen in FcMutexLock2022-03-08T13:49:46ZVincent Lefevrefrozen in FcMutexLockI got an issue with Gnuplot, which hanged in a call to fontconfig (from the libfontconfig1 2.13.1-4.4 Debian package), as shown by the backtrace:
```
Thread 1 (Thread 0x7ff9664a4b00 (LWP 259590) "gnuplot"):
#0 futex_wait (private=0, exp...I got an issue with Gnuplot, which hanged in a call to fontconfig (from the libfontconfig1 2.13.1-4.4 Debian package), as shown by the backtrace:
```
Thread 1 (Thread 0x7ff9664a4b00 (LWP 259590) "gnuplot"):
#0 futex_wait (private=0, expected=2, futex_word=0x7ff95c05c630) at ../sysdeps/nptl/futex-internal.h:146
__ret = -512
err = <optimized out>
#1 __lll_lock_wait (futex=futex@entry=0x7ff95c05c630, private=0) at lowlevellock.c:52
#2 0x00007ff96adcefe3 in __GI___pthread_mutex_lock (mutex=0x7ff95c05c630) at ../nptl/pthread_mutex_lock.c:80
__futex = 0x7ff95c05c630
type = <optimized out>
__PRETTY_FUNCTION__ = "__pthread_mutex_lock"
id = <optimized out>
#3 0x00007ff96ab0d547 in FcMutexLock (m=<optimized out>) at ./src/fcmutex.h:122
lock = <optimized out>
#4 0x00007ff96ab0e59e in FcCacheFindByAddr (object=0x7ff96cc73210) at ./src/fccache.c:663
ret = <optimized out>
skip = <optimized out>
#5 FcCacheObjectReference (object=0x7ff96cc73210) at ./src/fccache.c:750
skip = <optimized out>
#6 0x00007ff96ab27c08 in IA__FcPatternReference (p=<optimized out>) at ./src/fcpat.c:1232
#7 0x00007ff969be6959 in font_set_copy (fontset=<optimized out>) at ../pango/pangofc-fontmap.c:785
copy = 0x55c53ac4b660
i = <optimized out>
td = 0x55c53ac445c0
fontmap = <optimized out>
[...]
```
If I understand correctly, this can only occur in `fccache.c`, function `lock_cache`. I noticed the issue just after resizing the Gnuplot window to the maximum size because the contents were not redrawn, but after some debugging, it appears that this function is no longer called once the initial window has been fully drawn, so I suppose that the freeze actually occurred before the resize.
Note that `cache_lock` should be explicitly initialized to 0 as this is used by the `lock_cache` code in the `!lock` test (but this shouldn't be the cause of the bug as static variables are implicitly initialized). Moreover, there is a small memory leak in case `fc_atomic_ptr_cmpexch(...)` returns false since the memory that has just been allocated for `lock` is not freed before the `goto retry`, but again, this is not the cause of this bug.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/131FTBFS on hurd-i3862018-11-06T08:33:23ZLaurent BigonvilleFTBFS on hurd-i386Hello,
Apparently since 2.13, fontconfig FTBFS on hurd-i386.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912699 with the included patch
ThanksHello,
Apparently since 2.13, fontconfig FTBFS on hurd-i386.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912699 with the included patch
ThanksAkira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/185fullname should not be the same for all styles of variable fonts2020-02-03T06:29:59ZNicolas Mailhotfullname should not be the same for all styles of variable fontsRight now, fc-scan on
https://github.com/IBM/plex/blob/master/IBM-Plex-Sans-Variable/fonts/complete/ttf/IBMPlexSansVar-Roman.ttf
Returns a lot of different styles and families, but a single fullname
I'm quite sure this is going to brea...Right now, fc-scan on
https://github.com/IBM/plex/blob/master/IBM-Plex-Sans-Variable/fonts/complete/ttf/IBMPlexSansVar-Roman.ttf
Returns a lot of different styles and families, but a single fullname
I'm quite sure this is going to break apps right and left, fullname should point to a single (family,style) tuple
fontconfig-2.13.92-3.fc32.x86_64Akira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/347<glob> does not expand `~` as home directory2023-01-27T08:54:21ZOndrej Balaz<glob> does not expand `~` as home directory`<glob>` does not support paths relative to user's home directory (`~`). This can be useful when e.g. sharing user dotfiles across multiple systems with different username:
``` xml
<selectfont>
<rejectfont>
<glob>~/.local/sh...`<glob>` does not support paths relative to user's home directory (`~`). This can be useful when e.g. sharing user dotfiles across multiple systems with different username:
``` xml
<selectfont>
<rejectfont>
<glob>~/.local/share/fonts/bitmap</glob>
</rejectfont>
</selectfont>
```
I am willing to contribute patch for this, for PoC I simply used `FcStrCopyFilename()` but I am not sure if I understand correctly `FcConfigHome()` enablement/disablement. Theoretically glob starting with `~` can be in system-level config too and probably should work. Or does disabling `FcConfigHome()` also discard any font lookup in `~`?https://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 existi...## 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, Riccardohttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/382How can I compile fontconfig into a debug version under linux2023-08-25T06:06:31ZtwabrHow can I compile fontconfig into a debug version under linuxI use the command `./autogen.sh --enable-debug`
, but no effect.
I want to debug its source codeI use the command `./autogen.sh --enable-debug`
, but no effect.
I want to debug its source codehttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/301How does fontconfig handle duplicate font files ?2021-11-05T11:46:41ZAbhishek DeshpandeHow does fontconfig handle duplicate font files ?Let's say, I have a font installed in userspace, i.e. in my `~/.local/share/fonts` or `~/.fonts`.
Now, I installed a font package that contains the same font and same version. In this case, both the font files are exact duplicates of eac...Let's say, I have a font installed in userspace, i.e. in my `~/.local/share/fonts` or `~/.fonts`.
Now, I installed a font package that contains the same font and same version. In this case, both the font files are exact duplicates of each other. Then, which font file will be actually preferred by applications ?
How fontconfig will decide the priority ?https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/352how to build 32 bit fontconfig with centos 7.9 64bit system2023-02-21T06:43:10Zaisnotehow to build 32 bit fontconfig with centos 7.9 64bit system**Build env:**
Linux HW0016385 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Actually it is CentOs7 64bit.
**Question:**
I configure as below with -m32, but the **make **did not p...**Build env:**
Linux HW0016385 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Actually it is CentOs7 64bit.
**Question:**
I configure as below with -m32, but the **make **did not pick the option to build 32bit, it still build with 64bit.
Anyone can help? thanks.
```
./configure \
--with-arch=x86 \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-docs \
--enable-static=yes \
--enable-shared=no \
--with-pic=yes \
--docdir=/usr/share/doc/fontconfig-2.14.0 \
--build=i686-pc-linux-gnu \
CFLAGS="-m32 -std=c99" \
LDFLAGS="-m32"
if make ;
then
echo ------build successfully------!!!
else
echo ------build failed------!!!
exit 1
fi
```https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/366How to decode SVG fonts in fontconfig?2023-06-12T02:09:46ZJamaika1How to decode SVG fonts in fontconfig?I've created an ffmpeg decoder with librsvg but I can't figure out how to decode fonts in win64.
I have a strange message.
```
Fontconfig error: Cannot load default config file: No such file: (null)
Input #0, svg_pipe, from 'gvariant-byt...I've created an ffmpeg decoder with librsvg but I can't figure out how to decode fonts in win64.
I have a strange message.
```
Fontconfig error: Cannot load default config file: No such file: (null)
Input #0, svg_pipe, from 'gvariant-byte-boundaries.svg':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: svg, bgra, 154x51, 25 fps, 25 tbr, 25 tbn
1304.76 M-V: 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
```https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/394iconv not checked in meson2023-11-20T08:41:47Zvtorriiconv not checked in mesonconfigure.ac tries to detect iconv lib, but mesons does not. Is it normal ?configure.ac tries to detect iconv lib, but mesons does not. Is it normal ?https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/363Improve documentation of `acceptfont` and `rejectfont`2023-06-12T13:34:26ZWerner LembergImprove documentation of `acceptfont` and `rejectfont`The documentation should mention that `<acceptfont>` and `<rejectfont>` are only influenced by `<match target="scan">` and not by the targets `"font"` and `"pattern"`, together with an explanation why this is so.The documentation should mention that `<acceptfont>` and `<rejectfont>` are only influenced by `<match target="scan">` and not by the targets `"font"` and `"pattern"`, together with an explanation why this is so.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/353Include some more CJK fonts in stock config files2023-03-14T06:01:43ZRidley CombsInclude some more CJK fonts in stock config filesOn my macOS system, the default `sans-serif` font for CJK glyphs in `zh-HK` seems to be `HannotateTC`, which is fairly stylistic and not well-suited for use as a default font: ![image](/uploads/46f859e1ff565385b50662c9038146a8/image.png)...On my macOS system, the default `sans-serif` font for CJK glyphs in `zh-HK` seems to be `HannotateTC`, which is fairly stylistic and not well-suited for use as a default font: ![image](/uploads/46f859e1ff565385b50662c9038146a8/image.png)
This seems to be because there is no Hong Kong Chinese font in the macOS preinstalled set listed in fontconfig's stock config files, so fontconfig is simply falling back on the first font it finds (alphabetically?).
I'd suggest resolving this by adding some entries to the `65-nonlatin.conf` file:
For the `sans-serif` list:
- `PingFang SC`, `PingFang TC`, `PingFang HK` (default sans-serif Chinese fonts on macOS)
- `Hiragino Sans` (default sans-serif Japanese font on macOS)
- `Apple SD Gothic Neo` (default sans-serif Korean font on macOS)
And possibly also:
- `Hiragino Sans GB`, `Hiragino Sans CNS` (macOS-provided sans-serif simplified and traditional Chinese fonts)
For the `serif` list:
- `Songti SC`, `Songti TC` (default serif Chinese fonts on macOS)
- `Hiragino Mincho ProN` (default serif Japanese font on macOS)
- `AppleMyungjo` (default serif Korean font on macOS)
And possibly also:
- `SimSong` (macOS-provided serif simplified Chinese font)
It may also be helpful to include config data for Noto CJK, similar to the one [shipped by Arch](https://github.com/archlinux/svntogit-packages/blob/packages/noto-fonts-cjk/trunk/70-noto-cjk.conf) (though note that theirs mistakenly maps `serif` with `zh-HK` to `Noto Serif CJK TC`; it should be `Noto Serif CJK HK`). Noto fonts are already supported in other languages, and Noto CJK is now a very common group of free CJK fonts.https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/24Include TTF_NAME table fields in fontconfig's cache2022-07-01T06:16:03ZBugzilla Migration UserInclude TTF_NAME table fields in fontconfig's cache## Submitted by Nicolas Spalinger
Assigned to **fon..@..op.org**
**[Link to original bug (#18340)](https://bugs.freedesktop.org/show_bug.cgi?id=18340)**
## Description
Please include in the fontconfig cache the information contain...## Submitted by Nicolas Spalinger
Assigned to **fon..@..op.org**
**[Link to original bug (#18340)](https://bugs.freedesktop.org/show_bug.cgi?id=18340)**
## Description
Please include in the fontconfig cache the information contained in the following fields of the NAME table to allow better exposure of the existing font metadata contained in both open and restricted fonts.
These are standard fields already taken into account in Freetype:
in include/freetype/ttnameid.h
#define TT_NAME_ID_COPYRIGHT 0
#define TT_NAME_ID_FONT_FAMILY 1
#define TT_NAME_ID_FONT_SUBFAMILY 2
#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
#define TT_NAME_ID_VERSION_STRING 5
#define TT_NAME_ID_PS_NAME 6
#define TT_NAME_ID_TRADEMARK 7
#define TT_NAME_ID_MANUFACTURER 8
#define TT_NAME_ID_DESIGNER 9
#define TT_NAME_ID_DESCRIPTION 10
#define TT_NAME_ID_VENDOR_URL 11
#define TT_NAME_ID_DESIGNER_URL 12
#define TT_NAME_ID_LICENSE 13
#define TT_NAME_ID_LICENSE_URL 14
Then the cache can be queried for this information: utilities like fc-list or fc-match can report on the licensing/author/foundry for each font in the cache by default or via a parameter. Dedicated commands like fc-license could also be created.
Version: 2.6https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/219Inconclusive license2020-09-29T08:47:57ZRolf Eike BeerInconclusive licenseThe COPYING file contains the [HPND](https://spdx.org/licenses/HPND.html) license text, as well as several files. Other parts contain MIT license texts, as well as the spec file.The COPYING file contains the [HPND](https://spdx.org/licenses/HPND.html) license text, as well as several files. Other parts contain MIT license texts, as well as the spec file.Akira TAGOHAkira TAGOHhttps://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/337Inconsistent font smoothing defaults between GNOME and fontconfig2023-01-22T19:15:48ZTomasz GąsiorInconsistent font smoothing defaults between GNOME and fontconfigGNOME desktop defaults to grayscale-based font smoothing which is less appealing but more reliable and bug-free. Since commit https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/2b6afa02ab2b7dd3796a48cf47896c4c6de4d6ba fontconf...GNOME desktop defaults to grayscale-based font smoothing which is less appealing but more reliable and bug-free. Since commit https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/2b6afa02ab2b7dd3796a48cf47896c4c6de4d6ba fontconfig defaults to subpixel-based font smoothing (aka ClearType) which looks better on low-dpi monitors but may cause some red/green/blue shadows around letters.
While GTK-based apps follow GNOME preferences defined in GNOME's settings, there are many non-GNOME apps like Mozilla Firefox or VSCodium and other Electron apps which ignore desktop preferences and read font smoothing information directly from fontconfig.
This causes inconsistent font smoothing on my Fedora 36. F37 is probably affected too. While GNOME apps use grayscale, Firefox, my code editor and some other apps use font smoothing causing described unwanted shadows. For consistency font smoothing type should be the same in GNOME and in fontconfig.
Can we have linked commit reverted? Or should downstreams like Fedora patch GNOME or fontconfig to make font smoothing consistent?
There is downstream bug in RH bugzilla related: https://bugzilla.redhat.com/show_bug.cgi?id=2137825