Closed Bug 230002 Opened 21 years ago Closed 21 years ago

nsFontMetricsBeOS.cpp cleanup

Categories

(Core Graveyard :: GFX: BeOS, defect)

Other
BeOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.7alpha

People

(Reporter: Biesinger, Assigned: Biesinger)

Details

Attachments

(1 file)

nsIPref -> nsIPrefService, removal of some unnecessary memory allocations, and a
few other things
Attachment #138361 - Flags: review?(sergei_d)
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.7alpha
First notice:
+    isfixed = family.Equals("monospace") || family.Equals("fixed");

I'm unsure if 1) comparison should be case-sensitive 2) maybe family.Contains
(?) is more reliable
Second notice (you didn't know about, though)
-  if (!IsASCIIFontName(aName)) 
+  if (!IsASCII(aName)
Non-ascii utf-8 font names are allowed in BeOS, and even sometimes required.
So i think this check may be omitted at all - see bug 200589
and two patches there. I think it is good idea, as we doing cleanup, to
implement both here.


Also wondering if this patch will fix
http://bugzilla.mozilla.org/show_bug.cgi?id=173116
problem:)
Hope so
> 1) comparison should be case-sensitive

Well, the old version was case-sensitive as well

> 2) maybe family.Contains(?) is more reliable

I checked what families are used here, and it was always a single word like
"monospace" "fixed" "Arial" etc. so .Equals seems safe.
>I checked what families are used here, and it was always a single word like
>"monospace" "fixed" "Arial" etc. so .Equals seems safe.

this is safe if we use "generic" families.
But what happens if there is request by page source to use Arial, but we have.
for example "Arial Unicode" installed? Does it matter for this method?
Arial Unicode is not a fixed font...
ok, in this place it seems ok.
So it is notice for another places for future, when we will rewrite methods like
GetFontsList or such:)
If you think that this patch is wrong place to allow Japanese font names, i will
put review for it.
yes, I would prefer if the japanese fonts were addressed in a separate bug
Comment on attachment 138361 [details] [diff] [review]
patch

r=sergei_d@fi.tartu.ee
Attachment #138361 - Flags: review?(sergei_d) → review+
Checking in gfx/src/beos/nsFontMetricsBeOS.cpp;
/cvsroot/mozilla/gfx/src/beos/nsFontMetricsBeOS.cpp,v  <--  nsFontMetricsBeOS.cpp
new revision: 1.35; previous revision: 1.34
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: