Open Bug 380378 Opened 13 years ago Updated 12 years ago

Convert from em to ch widths


(SeaMonkey :: UI Design, defect, minor)

Not set


(Not tracked)


(Reporter: neil, Unassigned)


(Keywords: helpwanted)

Historically the only font-relative width unit we've had available has been the em. This suffers from the problem that it's only a height unit and therefore is inadequate for representing the width of an object. This means that the amount of width available for text depends on the aspect ratio of the font, which varies between fonts and also depends on the weight of the font. This means that dialogs have generally been sized for the Arial Normal font and anyone using other fonts (particularly the Mac, which defaults to bold fonts) loses out.

For an example, a width: 13em; in Arial 11px works out at 143px. I suggest this be changed to 18ch which works out at 144px. If you were using a wider font, this might change to (say) 176px, which would otherwise have necessitated an ugly hack to give the Mac a width of 16em to achieve the same result.
Some mxr hits:

>line 48 -- style="width: 40em; height: 30em;"

>line 111 -- <column style="width: .5em;"/>
>line 202 -- <column style="width: .5em;"/>
>line 284 -- <column style="width: .5em;"/>

>line 77 -- <vbox flex="1" style="max-width: 36em;"/>

>line 49 -- style="width: 25em;height: 28em;">

>line 38 -- <tree id="prefsTree" style="width: 13em;" flex="1"/>

>line 46 -- style="width: 30em;"

>line 52 -- style="width: 44em; height: 33em;">

>line 344 -- <tree id="jvmConfigListObj" style="width: 60em; height: 10em"

>line 50 -- style="width: 33em;"

>line 61 -- style="width: 45em;">

>line 52 -- style="width: 30em;"

>line 54 -- style="width: 45em;">

>line 54 -- style="width: 30em;"

>line 50 -- style="width:32em; height:42em;"

>line 57 -- style="width: 40em;"

>line 127 -- <spacer style="width: 36em;"/>

>line 52 -- style="width: 30em;"

>line 52 -- onload="Init()" style="width: 40em;"

>line 50 -- <dialog id="findBookmarkWindow" style="width: 36em;"

>line 48 -- <dialog id="findHistoryWindow" style="width: 36em;"

>line 59 -- style="width: 42em;"
>line 87 -- <description id="intro" style="width: 17em;"/>
>line 89 -- <description style="width: 17em;" class="label">&pmTextA.label;</description>

>line 12 -- style="width: 22em;"

>line 143 -- <textbox id="BackgroundImageInput" oninput="ChangeBackgroundImage();" style="min-width: 23em" flex="1" class="uri-element">

>line 280 -- <description class="wrap" flex="1" style="width: 1em">&cellUseCheckboxHelp.label;</description>

>line 70 -- <columns><column/><column style="min-width: 6em"/><column/></columns>

>line 64 -- <vbox style="min-width: 20em">

>line 89 -- <vbox align="center" style="max-width:30em">
>line 92 -- <description id="StatusMessage" class="wrap" style="max-width:30em; min-height: 1em"/>

>line 51 -- style="width: 40em;"

>line 91 -- <textbox id="ColorInput" style="width: 8em" oninput="SetColorSwatch(); SetDefaultToOk();"/>

>line 83 -- style="min-width:18em; max-width:18em;" crop="right"

>line 54 -- style="width: 32em;">
>line 68 -- <description id="TitleHelp" class="wrap" style="width:1em" />

>line 64 -- <vbox flex="1" style="width: 30em; height: 20em;">
>line 65 -- <textbox id="srcInput" multiline="true" rows="1" style="width: 1em" flex="1" class="uri-element"/>

>line 55 -- <columns><column style="width: 15em" flex="1"/><column flex="1"/></columns>

>line 52 -- style="min-width:20em">
More mxr hits:

>line 21 -- <!ENTITY prefWindow.size "width: 52em; height: 41em;">

>line 13 -- <!ENTITY prefWindow.size "width: 52em; height: 41em;">

>line 13 -- <!ENTITY prefWindow.size "width: 58em; height: 41em;">

>line 22 -- <!ENTITY accountManager.size "width: 55em; height: 50em;">
>line 23 -- <!ENTITY macAccountManager.size "width: 60em; height: 50em;">
>line 24 -- <!ENTITY accountTree.width "width: 17em;">

>line 4 -- <!ENTITY accountWizard.size "width: 40em; height: 38em;">

>line 39 -- <!ENTITY fieldMapImport.size "width: 40em; height: 30em;">

>line 4 -- <!ENTITY window.size "width: 47em; height: 32em;">
Keywords: helpwanted
Some approximate conversions:
 8em	11ch
13em	18ch
32em	44ch
40em	55ch
45em	62ch
Filter "spam" on "guifeatures-nobody-20080610".
Assignee: guifeatures → nobody
QA Contact: guifeatures
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.