freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freetype] Re: Suggested patch: bitmap fonts, foundry, family and fontco


From: Mike FABIAN
Subject: [Freetype] Re: Suggested patch: bitmap fonts, foundry, family and fontconfig/Xft2
Date: Wed, 09 Apr 2003 13:27:25 +0200
User-agent: Gnus/5.090014 (Oort Gnus v0.14) XEmacs/21.4 (Portable Code, x86_64-suse-linux)

Keith Packard <address@hidden> さんは書きました:

> Around 11 o'clock on Apr 9, Mike FABIAN wrote:
>
>> I believe yes because foundry appears to be used only for bitmap
>> fonts. Type1 apparently don't have something like foundry.  For
>> example
>
> What I also said was that we have bitmap fonts (Times, Helvetica and even 
> New Century Schoolbook) which clearly shouldn't have the foundry attached 
> to the family name as many documents refer to those fonts by name.

Even for those fonts I think it has good effects to prepend the
foundry name.

Let me try to explain why I believe this is good.

Many web-pages specify "Helvetica" for example. If the "Helvetica"
bitmap fonts are not renamed to "Adobe Helvetica", they are used,
because a direct specification of the family has highest
priority. This results in the surprising effect that bitmap fonts are
suddenly used where the user expected to see anti-aliased fonts.
To work around that problem, you suggested some time ago in address@hidden:

Keith> Here's what I put into my /etc/fonts/fonts.conf file (and which may go 
into
Keith> the distribution for 4.3):
Keith> 
Keith> <match target="pattern">
Keith>         <test name="prefer_outline">
Keith>                 <bool>true</bool>
Keith>         </test>
Keith>         <test name="family">
Keith>                 <string>Helvetica</string>
Keith>         </test>
Keith>         <edit name="family" mode="prepend" binding="strong">
Keith>                 <string>Arial</string>
Keith>         </edit>
Keith> </match>
Keith> 
Keith> <match target="pattern">
Keith>         <test name="prefer_outline">
Keith>                 <bool>true</bool>
Keith>         </test>
Keith>         <test name="family">
Keith>                 <string>Times</string>
Keith>         </test>
Keith>         <edit name="family" mode="prepend" binding="strong">
Keith>                 <string>Times New Roman</string>
Keith>         </edit>
Keith> </match>
Keith> 
Keith> These rules map Helvetica to Arial and Times to Times New Roman.  As you
Keith> probably know, Monotype was paid by MS to create Arial as an Helvetica
Keith> "clone" so that MS wouldn't have to pay the Linotype license fee (a
Keith> per-copy royalty); it's not the same as Helvetica, but it does have 
Keith> essentially identical escapements which means type set with Helvetica 
will 
Keith> line up the same as type set with Arial.  Verdana is quite a bit wider 
set,
Keith> making it a less suitable replacement.
Keith> 
Keith> To enable these rules, I place:
Keith> 
Keith> <match target="pattern">
Keith>         <edit name="prefer_outline">
Keith>                 <bool>true</bool>
Keith>         </edit>
Keith> </match>

If "Helvetica" is renamed to "Adobe Helvetica", this problem is also
solved, although in a somewhat different way.

Then, "Helvetica" doesn't exist any more, but it is marked as a
sans-serif face in fonts.conf:

<!--
  Sans-serif faces
 -->
        <alias>
                <family>Helvetica</family>
                <family>Arial</family>
                <family>Verdana</family>
                <family>Bitstream Vera Sans</family>
                <family>Nimbus Sans L</family>
                <family>Luxi Sans</family>
                <family>Kochi Gothic</family>
                <family>AR PL KaitiM GB</family>
                <family>AR PL KaitiM Big5</family>
                <family>Baekmuk Gulim</family>
                <family>Baekmuk Dotum</family>
                <family>SimSun</family>
                <default><family>sans-serif</family></default>
        </alias>

Therefore the first "suitable" font from the "prefer" aliases for
sans-serif is used instead of "Helvetica":

        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>Verdana</family>
                        <family>Bitstream Vera Sans</family>
                        <family>Nimbus Sans L</family>
                        <family>Luxi Sans</family>
                        <family>Arial</family>
                        <family>Helvetica</family>
                        <family>Kochi Gothic</family>
                        <family>AR PL KaitiM GB</family>
                        <family>AR PL KaitiM Big5</family>
                        <family>Baekmuk Gulim</family>
                        <family>Baekmuk Dotum</family>
                        <family>SimSun</family>
                        <family>HanyiSong</family>
                        <family>ZYSong18030</family>
                </prefer>
        </alias>


This usually gives quite good results. One gets a anti-aliased
sans-serif font as expected and if one absolutely insists on using the
Helvetica-Bitmap font it is still possible by specifying "Adobe
Helvetica".

If something like the following is added to /etc/fonts/fonts.conf
below the line where ~/.fonts.conf is included

    <match target="pattern">
            <test name="prefer_bitmap" compare="eq">
                    <bool>true</bool>
            </test>
            <test name="family">
                    <string>Helvetica</string>
            </test>
            <edit name="family" mode="prepend" binding="strong">
                    <string>Adobe Helvetica</string>
            </edit>
    </match>

    <match target="pattern">
            <test name="prefer_bitmap">
                    <bool>true</bool>
            </test>
            <test name="family">
                    <string>Times</string>
            </test>
            <edit name="family" mode="prepend" binding="strong">
                    <string>Adobe Times</string>
            </edit>
    </match>

     <match target="pattern">
            <test name="prefer_bitmap">
                    <bool>true</bool>
            </test>
            <test name="family">
                    <string>Fixed</string>
            </test>
            <edit name="family" mode="prepend" binding="strong">
                    <string>Misc Fixed</string>
            </edit>
    </match>

a user who prefers to use the bitmap fonts can write

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>

            <dir>/usr/X11R6/lib/Acrobat5/Resource/Font</dir>

            <match target="pattern">
                    <edit name="prefer_bitmap">
                            <bool>true</bool>
                    </edit>
            </match>
    </fontconfig>

into his ~/.font.conf.

Another example where I recently found that prepending of "Adobe " for
the Helvetica-bitmap-fonts had a good effect was icewm 1.2.6.

icewm uses Xft by default but (unfortunately) still specifies the
fonts as XLFDs in the config files and uses XftFontOpenXlfd() to open
the fonts.

After renaming "Helvetica" -> "Adobe Helvetica" with my freetype
patch,

    "-adobe-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"

was opened as the most "suitable" sans-serif font. I.e. I got nice
anti-aliased fonts here by default where I would have gotten ugly
bitmap fonts if "Helvetica" still existed.  Even Japanese worked "out
of the box" without changing the setup of icewm because "Kochi Gothic"
was automatically selected as the first sans-serif font from the
prefer list which supports Japanese.

I.e. I think that renaming the bitmap fonts

    "Helvetica" -> "Adobe Helvetica"
    "Times" -> "Adobe Times"
    "New Century Schoolbook" -> "Adobe New Century Schoolbook"

usually has good effects.

As you wrote in the part I quoted above, the first suitable font from
the sans-serif "prefer" list might not be optimal because it has
somewhat different metrics. It is better to use Arial as a replacement
for Helvetica instead of Verdana, etc...

But because we cannot be sure that Arial is installed, it is maybe not
so nice to configure only Arial as a replacement for the
Helvetica-Bitmap-fonts into fonts.conf by default.

But the URW fonts from Ghostscript should be usually available and
these are probably available in most cases.

Therefore it may be a good idea to configure "Arial" and "Nimbus Sans
L" in that as default replacements for "Helvetica".  Same with "Nimbus
Roman No9 L" as a default replacement for "Times", and "Century
Schoolbook L" as a default replacement for "New Century Schoolbook".

Then one can have anti-aliased fonts by default and can easily switch
to using lots of bitmap fonts instead by setting prefer_bitmap=true.

-- 
Mike Fabian   <address@hidden>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。



reply via email to

[Prev in Thread] Current Thread [Next in Thread]