FS#3342 - Patch for fontconfig to support artificial bold font

Attached to Project: Arch Linux
Opened by Mark Lam (sunshine) - Sunday, 16 October 2005, 08:23 GMT
Last edited by Judd Vinet (judd) - Monday, 17 October 2005, 02:19 GMT
Task Type Feature Request
Category System
Status Closed
Assigned To Jan de Groot (JGC)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi

The artificial bold font rendering is supported since cairo 1.0+freetype2.1.10/libxft2.1.7+freetype2.1.10 . However it depends on "embolden" option of fontconfig.

Applications depends on Gtk 2.8.X use cairo to accelerate text and draw client-side glyphs,such as Gedit ...
And others use libXft,such as Qt base applications,kate,kwrite,Opera... . All the applications use freetype as font engine. The new version of freetype(reeftype2.1.10) have added FT_GlyphSlot_Embolden API so that it can emulated bold style font if font is regular style only,

Because some font only have "Regular" style face,in particular CJK font are usual only have "Regular" style.
The patch is for enable the "embolden" option of fontconfig.But first need to hack the xorg. Need libxft-embold patch to let libxft2.1.7 pick up FT_GlyphSlot_Embolden API of freetype,

I also commit the libxft-embold patch here

It will very exciting if Arch has artificial embold font support by default. By now only SUSE and Mandriva
have artificial embold font support by default,Enven Not Fedora core 4 and Ubuntu 5.10

The new series fontconfig have new way to load the customization files Each file in /etc/fonts/con.d directory is a fontconfig configuration file. Fontconfig scans this directory, loading all files of the form [0-9][0-9]*, so if you want to use any of these options, link them to a name of that form. E.g.

$ ln -s no-bitmaps.conf 10no-bitmaps.conf

It need to add one line to font.conf for activativing the con.d directory, Many Disotro are now use this new way, SUSE,Debian,Mandriva,Gentoo.....
So I think it time to Arch :-)

@@ -208,6 +208,7 @@
<!--
Load local system customization file
-->
+ <include ignore_missing="yes">conf.d</include>
<include ignore_missing="yes">local.conf</include>

<!--
@@ -333,6 +334,25 @@
</edit>
</match>

Above patch also in the embold-fontsconf.patch I uploaded
This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 02 January 2006, 20:34 GMT
Reason for closing:  Implemented
Additional comments about closing:  We use upstream fonts.conf now, upstream fonts.conf supports embolden assignment.
Comment by Mark Lam (sunshine) - Sunday, 16 October 2005, 08:28 GMT Comment by Mark Lam (sunshine) - Tuesday, 08 November 2005, 19:58 GMT
The rule for artificial emboldening have been add to Fontconfig by upstream(in fontconfig 2.3.92),some what different from I posted. So the the patch don't need.

And I wonder why not Arch linux don't use the fonts.conf file that provide by fontconfig itself?
Because the fonts.conf file has some change and some improvement than the one Arch provided !
So I suggest delete this line "install -D -m644 ../fonts.conf $startdir/pkg/etc/fonts/fonts.conf" in the PKGBUILD.
Comment by Jan de Groot (JGC) - Tuesday, 08 November 2005, 20:12 GMT
You know fontconfig 2.3.9x is a alpha/beta/rc version?
Comment by Mark Lam (sunshine) - Tuesday, 08 November 2005, 20:56 GMT
Yes,I know that. What's the problem ?
Comment by 甘露(Lu Gan) (ganlu) - Thursday, 10 November 2005, 15:20 GMT
Let's wait a bit, Arch doesn't support alpha software. Anyway it's a good news,
Comment by Mark Lam (sunshine) - Thursday, 17 November 2005, 09:05 GMT
new rule from Fontconfig 2.3.92


<!--
Synthetic emboldening for fonts that do not have bold face available
-->

<match target="font">
<!-- check to see if the font is just regular -->
<test name="weight" compare="less_eq">
<const>medium</const>
</test>
<!-- check to see if the pattern requests bold -->
<test target="pattern" name="weight" compare="more">
<const>medium</const>
</test>
<!--
set the embolden flag
needed for applications using cairo, e.g. gucharmap, gedit, ...
-->
<edit name="embolden" mode="assign">
<bool>true</bool>
</edit>
<!--
set weight to bold
needed for applications using Xft directly, e.g. Firefox, ...
-->
<edit name="weight" mode="assign">
<const>bold</const>
</edit>
</match>

Loading...