Opened 15 years ago
Closed 15 years ago
#1437 closed enhancement (fixed)
[patch][cla] True font height metrics in pixels, scrollbar width in pixels, font resize detection
| Reported by: | morris | Owned by: | Tom Trenka |
|---|---|---|---|
| Priority: | high | Milestone: | 0.9 |
| Component: | HTML | Version: | 0.3 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
A widget that has four features:
a) Provides an event when fontsize is changed in the browser (e.g. ctrl- or ctrl+)
b) Provides true pixel metrics for font heights given in ems, %, pixels, points or fixed sizes such as large, x-large.
c) Gives true measurement of the pixel width of scroll bars.
d) Fixes IE5/IE6 problem with em and % not being same.
Attached widget works (although currently it is defined within its own namespace instead of the dojo namespace).
Attachments (1)
Change History (14)
Changed 15 years ago by
| Attachment: | mojo_metrics.zip added |
|---|
comment:1 Changed 15 years ago by
| Milestone: | → 0.4 |
|---|---|
| Summary: | True font height metrics in pixels, scrollbar width in pixels, font resize detection → [patch][cla] True font height metrics in pixels, scrollbar width in pixels, font resize detection |
| Version: | 0.4 → 0.3 |
comment:2 Changed 15 years ago by
I don't see why this should be a widget, nor a class: no need to have more than one instance of this widget per page, right?
Maybe you can consider just defining it as an object, such as dojo.html.metrics, and move the file to src/html/metrics.js
comment:4 Changed 15 years ago by
Cougar, I just prefer dojo templates to DOM javascript code. That said, it could easily be rewritten to use a single innerHTML and just have ids on the two elements I need to reference since it is global anyway.
I dont think it is worthwhile splitting out the functionality into separate objects - too many small files just leads to overheads. The IE fix is required for the IE font metrics to work properly so although it doesnt fit in, it is in there. Morris.
comment:5 Changed 15 years ago by
I think no one would want to customize the template for this widget, so I assume using innerHTML is sufficient in an object
I agree too many small files are no good. However, we do have a build system, so in a production environment, that would not be an issue.
Anyway, I don't really care much about whether they are in one file or many.
thanks
comment:6 Changed 15 years ago by
| Owner: | changed from bill to Tom Trenka |
|---|
I'll take it, and figure out the best way to deal with it/use it.
comment:8 Changed 15 years ago by
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
comment:10 Changed 15 years ago by
| Milestone: | 0.4 → 0.5 |
|---|
I'm going to punt this to 0.5; not that I don't want to add it now but I want to take a very close look at it, and do it in a way that is not widgeted. Preferably adding it as measurement functions to dojo.html, and I will want to add a few other ones at the same time (such as actual font measurements, which I have sitting around).
I would try to add it but since today is the 0.4 feature freeze...I don't think I can get it in in time. Of course, if we push the freeze back a couple of days...
comment:11 Changed 15 years ago by
The scrollbar measurement and the font height measurements have been merged into dojo.html as metrics functions; I will keep this ticket open for the resize event in 0.5.
comment:12 Changed 15 years ago by
| Component: | Widgets → HTML |
|---|
comment:13 Changed 15 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
widget js file and test