[Fontconfig] Patch to improve the rule for artificial emboldening

Mike FABIAN mfabian at suse.de
Thu Sep 29 20:16:34 EST 2005


For details please see

http://bugzilla.novell.com/show_bug.cgi?id=118727

This patch makes two small changes to the rule for artificial
emboldening in /etc/fonts/fonts.conf:

1)
    don't check for "weight >= 200" but for "weight > 100",
    i.e. instead of 

                <!-- check to see if the pattern requests bold -->
                <test target="pattern" name="weight" compare="more_eq">
                        <int>200</int>
                </test>

    use

                <!-- check to see if the pattern requests bold -->
                <test target="pattern" name="weight" compare="more">
                        <int>100</int>
                </test>

    This is necessary to make <strong>foo</strong> appear bold
    in firefox. When checking "weight >= 200", emboldening will work for

        <span style="font-weight:bold;">foo</span>

    in firefox but not for <strong>foo</strong>

    (To make it a better readable I used "<const>medium</const>"
    instead of "<int>100</int>". This makes no functional difference
    it only enhances the readability).

2)
    in addition to setting "embolden" to "true", also set
    "weight" to "bold", i.e. add:

		<!--
		 set weight to bold
		 needed for applications using Xft directly, e.g. Firefox, ...
		-->
		<edit name="weight" mode="assign">
			<const>bold</const>
		</edit>

    to the rule. This is necessary to make artificial emboldening
    work in applications who do no (yet) use cairo but use
    Xft directly[1]

Footnotes: 
[1]  to make this work Xft needs to have the patch for embedded bitmap
support and artificial emboldening applied which I attach here as well
for reference.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fonts.conf-embolden.patch
Type: text/x-patch
Size: 1091 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20050929/295e4712/fonts.conf-embolden.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p_xft_cjk.diff
Type: text/x-patch
Size: 7382 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20050929/295e4712/p_xft_cjk.bin
-------------- next part --------------

-- 
Mike FABIAN   <mfabian at suse.de>   http://www.suse.de/~mfabian
?????????????


More information about the Fontconfig mailing list