Benches Apps and software

11

Force a fixed width font?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I have some pages that contain source code that should be displayed in a fixed width font. I initially used Bitstream Vera Sans Mono, but when I tested the site from a Windows machine using Firefox and IE, the font was converted to variable width. I changed to one of the Web fonts, Andale Mono, but found the same behavior on Firefox, IE, and Chrome.

How do I configure a text box to display a preferred fixed width font and fail back to an available fixed width font if the specified one isn't available?

Thanks,

Patrick

11 replies

Sign in or join Beachball Help to reply.

  1. 0

    Roddy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Chose your font from the web-safe Mac/Windows list - not the Web list.

  2. 0

    Old Toad

    Imported from the Apple Support Forums via the Wayback Machine 🔗

  3. 0

    Patrick J. May

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I don't have a set called Mac/Windows in my font list.

    Thanks,

    Patrick

  4. 0

    Patrick J. May

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks for the links. I switched to use only Arial and Courier New and the code now displays correctly on Firefox and IE.

    I'd still like to know how to specify a list of acceptable fonts, so that the code appears in Bitstream Vera Sans Mono if available and Courier New otherwise. Is that possible?

    Thanks again,

    Patrick

  5. 0

    Roddy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Web-safe Mac/WIndows fonts are:

    Arial

    Arial Black

    Comic Sans MS

    Courier New

    Georgia

    Helvetica

    Impact

    Times

    Times New Roman

    Trebuchet MS

    Verdana

  6. 0

    BarryUK

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Are you using CSS? If so you would do it like this;

    font-family: "Bitstream Vera Sans Mono","Courier New", monospace;

    That tells the browser to use Vera Sans if it is installed, if it isn't it will try to use Courier New, and if that isn't installed it will use the browser's default monospace font.

    Note that you only need to enclose the font name in quotes if there are spaces in the name, so you wouldn't need to wrap Arial in quotes.

  7. 0

    Patrick J. May

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Does iWeb allow that kind of specification without modifying the underlying files? I usually create websites using Emacs, but I was hoping that iWeb would be sufficient for quick site creation.

    Thanks,

    Patrick

  8. 0

    Old Toad

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    See this tutorial from 11 Mystics on how to control how fonts are used and displayed for PC’s:
    http://11mystics.com/blog/2007/09/12/how-can-i-ensure-the-fonts-i-use-will-look- good-on-a-pc/

    OT

  9. 0

    Patrick J. May

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Converting fonts to images isn't a viable option. The increase in download size would be significant.

    Regards,

    Patrick

  10. 0

    Old Toad

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The tutorial at 11 Mystics describes how to edit the FontMapping.plist file in iWeb so you can control which fonts are substituted for the ones you use in your site. The method described does not convert to png but substitutes a font that you specify for the one used on Windows computers.

  11. 0

    Patrick J. May

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Sorry about that, I'll check more closely.

    Thanks,

    Patrick