Closed
Bug 166919
Opened 23 years ago
Closed 23 years ago
[ps] nsAFMObject does not look up fonts correctly
Categories
(Core :: Printing: Output, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.2beta
People
(Reporter: rods, Assigned: rods)
Details
Attachments
(1 file, 2 obsolete files)
|
2.79 KB,
patch
|
dcone
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
| Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
OS: Windows 2000 → Linux
Target Milestone: --- → mozilla1.2beta
| Assignee | ||
Comment 1•23 years ago
|
||
As stated in the patch:
Some aFontNames have a more than one font separated by a ","
for example: "arial,serif"
This chops the name up per the comma and checks each font name looking for a
match, if not then it fails.
| Assignee | ||
Comment 2•23 years ago
|
||
"when it fails" means it defaults to "times"
| Assignee | ||
Comment 3•23 years ago
|
||
Parse for font names, I can use strtok because I am comparing against char*
names anyway.
Attachment #97995 -
Attachment is obsolete: true
Comment 4•23 years ago
|
||
rods wrote:
> Parse for font names, I can use strtok because I am comparing against char*
> names anyway.
What about using POSIX |strtok_r()| or |PR_strtok_r()| instead of using nsCRT::
?
Attachment #98016 -
Flags: superreview+
Updated•23 years ago
|
Summary: nsAFXObject does look up fonts correctly → [ps] nsAFMObject does look up fonts correctly
Comment 6•23 years ago
|
||
Um.. http://lxr.mozilla.org/seamonkey/source/gfx/public/nsFont.h#121
nsFont::EnumerateFamilies. It seems like it would be a good idea to use that
here and not duplicate the parsing code from nsFont, no?
Comment 7•23 years ago
|
||
Comment on attachment 98016 [details] [diff] [review]
patch with strtok
r=dcone. I think this is the correct way to fix this.
Just look at what we talked about.
Attachment #98016 -
Flags: review+
Comment 8•23 years ago
|
||
Comment on attachment 98016 [details] [diff] [review]
patch with strtok
font-family: Times, "Bookman Antique, Condensed", Helvetica;
I fail to see how parsing this with strtok can possibly be a good idea.
Attachment #98016 -
Flags: needs-work+
Updated•23 years ago
|
Summary: [ps] nsAFMObject does look up fonts correctly → [ps] nsAFMObject does not look up fonts correctly
Comment 9•23 years ago
|
||
I don't understand why parsing with strtok is such a bad idea? Its simple, easy
to maintain, gets the job done with a small amount of code. A space and a quote
is all that would be needed in the token string to fix the problems in the
example you give. I am not trying to argue or put any particular fix down.. I
am just curious about why you think the strtok is so bad... is it overlooking
anything that nsFont::EnumerateFamilies is doing and needs for this particular
problem.. if its not.. it seems to be the faster.. less complex solution to this
problem.
| Assignee | ||
Comment 10•23 years ago
|
||
Yes, the font def is more complicated than I thought:
http://www.w3.org/TR/REC-CSS2/fonts.html#font-family-prop
This patch uses nsFont::EnumerateFamilies
Attachment #98016 -
Attachment is obsolete: true
Comment 11•23 years ago
|
||
Comment on attachment 98441 [details] [diff] [review]
patch with Enum
r=dcone
Attachment #98441 -
Flags: review+
Comment 12•23 years ago
|
||
Comment on attachment 98441 [details] [diff] [review]
patch with Enum
Rod, thanks. sr=bzbarsky if you add a null-check on the ToNewCString() return
value and stop the enumeration if it returned null...
Don, comment 8 has 3 font families listed. strtok would parse it as 4 font
families.
Attachment #98441 -
Flags: superreview+
| Assignee | ||
Comment 13•23 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•