Here various issues of displaying Box Drawing Characters characters in different operating systems and browsers will be identified and discussed.

Font in CSS

The existing CSS for the Wiki themes has Courier listed instead of Courier New. This may cause issues both in Internet Explorer and Firefox by using the non-TrueType Courier font kept arround for old applications. Fixing it with User CSS in UserPreferences, makes Firefox work fine on Windows, but not necessarily on other OS'.

Windows

As it was noted earlier (J General Forum Jan 14, 2006, Jan 31, 2006), display of Box Drawing Characters depends on typesetting logic and environment of the underlying OS: availability of particular fonts and choice made selecting them.

Box Drawing characters are given in the web browser as Unicode ranges.

On Windows this range seems to be tied up with historic PC/DOS code pages, where they appeared originally. The misalignment of boxes seen in J pages, is also reflected in the choice of glyphs for DOS encodings.

The following pictures we obtained on the same machine side-by-side with the Upper ASCII Charset page and selected Encoding: Cyrillic DOS (866) or Eastern European DOS (852). Note how non-Courier New glyphs are wider and not antialiased in IE.

UpperAscii.png

Firefox gets the glyphs from Courier New only, whereas Internet Explorer tries to map Unicode to the DOS codepage, then finds a font for it, which is already not Courier New.

Box Drawing characters in Unicode are somewhat related to the higher Unicode sets, close to Far Eastern language sets. So certain confirgurations for Far Easter langauge support may interfere with Box Drawing characters. These settings are located in XP on the Control PannelRegional and Language Options, Languages tab, [Details] screen and Supplemental Language Support section.

Regional.png

The fonts with @ such as @Batang, @Gulim etc. contain characters for extended ranges. It was also noted in some installations of Windows XP, they have extension .ttc not .ttf in the Windows\Fonts folder.

This is the list of such files:

batang.ttc
gulim.ttc
mingliu.ttc
msgothic.ttc
simsun.ttc

Removing them, removes the Box Drawing ability from Internet Explorer totally -- just empty spaces. Bringing them back, creates the misalignment. On the other Windows XP machines, where they have extension .ttf and slightly different size, but the same version, misalignment did not happen.


Indeed, Fonts in "East Asia" Language Collection contain the fonts mentioned above: .ttc is a fonts collection having more than one TrueType font to share common glyphs.

-- OlegKobchenko 2006-02-02 22:53:06


After a fresh install of Windows XP, using Internet Explorer, alignment in Courier New font is preserved, both when mixed with non-TrueType Courier from a modern CSS and by itself in a custom CSS:

newxp.png

So misalignment is introduced later, when more fonts or support for extended Unicode scripts are installed.

-- OlegKobchenko 2006-02-16 06:20:48

Linux

<!> Information needed.

Mac OS X

BrianSchott wrote Jan 13, 2006:


By varying the Fixed-width font selection in Appearence tab of Safari Preferences, the following are typical results for supplied Mac OS X fonts:

Safari.png

It turns out that none of standard fonts have box-drawing characters in their repertoir. Other Unicode fonts, intended for far-eastern characters, are used to substitute them. The results is the same misalignment as seen on Windows.



Contributed by OlegKobchenko.


Discussion


In my case, Box Drawing Characters are not treated as fixed width by the browser in the default ("modern") style, but are treated as fixed width using the "monomoin" style.

According to an introspection feature of my browser, here's a list of the css styles for the box drawing characters in question:

"modern"

"monomoin"

Font & Text

font-family

courier, monospace

font-size

16px

12.6667px

line-height

20px

13.9333px

white-space

-moz-pre-wrap

Color & Background

background-color

#FFF8ED

#F0F9F3

color

#000000

Box

height

160px

111.467

width

917px

733.667

border

1px solid #AEBDCC

1px dashed #2F6FAB

margin

16px 16px 0 0

13px 13px 0 0

padding

7px 7px 7px 7px

13px 13px 13px 13px

Positioning

display

block

Since font-family is the same in both variants, but the font-size is different, I suspect the issue is that fixed-width box drawing character are not supported in the 16px font used by the "modern" theme. (Note: Oleg's later writeup, above, suggests that the actual issue is subtly different.)

For immediate relief, perhaps monomoin could become the default theme for unregistered users. Perhaps also, the font-family in http://www.jsoftware.com/wiki/modern/css/common.css should become courier new, monaco, courier, monospace? I've not tested that one myself.

Dealing with browser compatibility issues can be messy, and the differences between the "modern" and "monomoin" layout can be disconcerting, so as specific advice the "monomoin" suggestion is worth a grain of salt. But having messed up box drawing characters is also disconcerting.

-- Raul Miller 2006-05-22 19:13:05

Alternatively, since box drawing characters are so unreliable for browsers, perhaps we should think seriously of reverting to +----+ style boxes for wiki purposes. -- Raul Miller 2007-10-23 12:35:24

Typesetting/Box Drawing Fonts (last edited 2008-12-08 10:45:35 by )