Re: Encoding/characterset/font family confusion



Toby A Inkster wrote:

Hi Toby,

Erwin Moller wrote:

A few day ago I discovered that the euro-sign is not defined in all
fontfamilies.

Browsers are *supposed* to switch fonts when they encounter a character
that does not exist in the current font. Unfortunately, Internet Explorer
is famously bad at this.

Yes, the 'browser' in question was IE6.

Changing fontfamily to Arial helped, but from a designers point of view it
would have been nicer to have the same font all over the page.


They cannot produce the right sign no matter if I use € or the
hexadecimal equivalent.

Yep -- it's not a problem with the way you've specified the character,
just a problem that the browser is trying to display it using a font that
doesn't contain that character.

After a little research I found I could put font-tags around the
euro-sign with another font-family (Arial in this case) to get the Euro
sign.

If you care about the symbol being rendered correctly in legacy browsers,
then this is the best solution. Either change the fonts of your whole
page, or use a little PHP+HTML+CSS:

It tried to switch to Arial, but my designer doesn't let me change the font
for the site.
These people are so strict!
I stopped asking what is wrong with monospaced fonts, such questions are
dangerous for my wellbeing. ;-)


$str = str_replace('€',
'<acronym class="e" title="euro">&euro;</acronym>',
$str);

With CSS:

acronym.e { border-bottom:none; font-family: "Arial"; }

If you use output buffering, then you should be able to do this with
minimal code changes.

I'm actually doing something fairly similar on a current project, but with
ampersands instead of euro-signs. I wanted them all rendered in a
particular font which has an especially nice ampersand, but didn't want
the rest of the page to appear in that font.

Also, take a look at Jukka's page on the euro sign:
http://www.cs.tut.fi/~jkorpela/html/euro.html

Found that page earlier in my quest for the euro.

Thanks for your comment.

Regards,
Erwin Moller


As far as character sets are concerned, do not worry too much. HTML
documents effectively have two character sets: the one they're transmitted
in and the one they're translated into by the browser. The one they're
translated into is always Unicode, so always includes the euro symbol. So
you just need to worry about the one they're transmitted in -- you've
chosen ISO-8859-1, which does not include the euro symbol, but all that
means is that you need to use an entity instead -- you can't just type in
a raw ?.


.



Relevant Pages

  • Re: stand or sit?
    ... >> emacs uses may predate common usage of the euro sign. ... I see both the splotch and the Euro symbol, but your character set ... so am having to switch to ISO-8859-N (haven't decided if ... I"ve switched my base Windows font size to LARGE FONTS. ...
    (soc.motss)
  • Re: Fitting the Page to Various Resolutions
    ... website CSS settings. ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... > You can't "lock" font size with CSS. ... >> Nothing you can do about it, the user can increase the font size in their browser as long as you ...
    (microsoft.public.frontpage.client)
  • Re: string resizing
    ... Then you need a table of character widths in pixels. ... know any scaling factor that has been applied to the font so you can ... like "what browser and what font and what size?", ...
    (microsoft.public.dotnet.framework.aspnet)
  • 49G[+] Bug in ~Choose (ROMPTR B3 0)
    ... The test program 'P0' alternates between current fonts ... its message handler sets up the full-screen option, ... to the built-in defaults of the browser. ... What you will find is that when the current font ...
    (comp.sys.hp48)
  • Re: Setting Standards for Text
    ... > find most browser default settings to be on the ... When you're making your designs flexible enough, ... browser, whatever it may be. ... Mozilla) and setting it to disregard font settings below a certain ...
    (comp.infosystems.www.authoring.stylesheets)