Closed Bug 136743 Opened 23 years ago Closed 22 years ago

xlib complains a lot about fonts with '*' in the XLFD string

Categories

(Core Graveyard :: GFX, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.0

People

(Reporter: timeless, Assigned: roland.mainz)

Details

(Keywords: assertion)

Attachments

(2 files, 4 obsolete files)

xlib to qnx xphoton WEBSHELL+ = 3 ###!!! ASSERTION: atoi(resolutionX) failure.: '!(resolutionX[0] != '0' && resX == 0)', file /home/timeless/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp, line 4109 ###!!! Break: at file /home/timeless/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp, line 4109 Suspending process; attach with the debugger. Program received signal SIGSTOP, Stopped (signal). 0x284527d0 in kill () from /usr/lib/libc_r.so.4 (gdb) Continuing. ###!!! ASSERTION: atoi(resolutionY) failure.: '!(resolutionY[0] != '0' && resY == 0)', file /home/timeless/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp, line 4117 ###!!! Break: at file /home/timeless/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp, line 4117 Suspending process; attach with the debugger.
Attached file xlsinfo
Ok, this appears to be a bug in mozilla xlib #3 0x28d92501 in GetFontNames (aPattern=0xbfbfd11c "-*-helvetica-*-*-*-*-*-*-*-*-*-*-*-*", aAnyFoundry=1, aNodes=0x8675440) at /home/timeless/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp:4117 (gdb) p list[i] $3 = 0x86a3001 "-*-helvetica-medium-i-normal-*-12-*-*-*-*-*-iso8859-1" patch coming
Keywords: assertion
Attached patch check for * instead of just 0 (obsolete) — Splinter Review
this fixes the assertion, i'm guessing it's the right fix too :) i'm attaching the patch using an xlib mozilla running with the patch :)
Looking at attachment 78624 [details]: I never saw things like this in a "xlsfonts" output: -- snip -- -*-helvetica-medium-i-normal-*-12-*-*-*-*-*-iso8859-1 -*-helvetica-medium-i-normal-*-7-*-*-*-*-*-iso8859-1 -*-lucidasans-medium-r-normal-*-10-*-*-*-*-*-iso8859-1 -*-lucidasans-medium-r-normal-*-12-*-*-*-*-*-iso8859-1 -*-lucidasans-medium-r-normal-*-14-*-*-*-*-*-iso8859-1 -*-lucidasans-medium-r-normal-*-18-*-*-*-*-*-iso8859-1 -*-lucidasans-medium-r-normal-*-24-*-*-*-*-*-iso8859-1 -*-lucidasans-medium-r-normal-*-8-*-*-*-*-*-iso8859-1 -- snip -- bstell: Are this legal XLFDs ?
The wildcard character '*' is allowed in the pattern used to query for fonts but not in the font name. See: http://www.x-docs.org/XLFD/xlfd.pdf 3.1.1. FontName Syntax The FontName is a structured, parsable string ... Field values are constructed as strings of ISO 8859-1 graphic characters, excluding the following: • ‘‘-’’ (HYPHEN), the XLFD font name delimiter character => • ‘‘?’’ (QUESTION MARK) and ‘‘*’’ (ASTERISK), the X protocol font name wildcard characters • ‘‘,’’ (COMMA), used by Xlib to separate XLFD font names in a font set. • ‘‘"’’ (QUOTATION MARK), used by some commercial products to quote a font name.
Since there is no way for the font code to specify these fonts I suggest we consider them invalid.
Brian Stell wrote: > Since there is no way for the font code to specify these fonts I suggest > we consider them invalid. OK, I'll file a new patch to reject these fonts...
Status: NEW → ASSIGNED
Attachment #78733 - Flags: needs-work+
Summary: xlib complains a lot → xlib complains a lot about fonts with '*' in the XLFD string
Target Milestone: --- → mozilla1.0
Attached patch Patch for 2002-04-09-08-trunk (obsolete) — Splinter Review
The new patch rejects the font if certain values contain '*' and adjust the assertion to stop complaining (since the font is rejected anyway...) ...
Attachment #78733 - Attachment is obsolete: true
Requesting r=/sr=/a= ...
Keywords: patch, review
Same patch as previous one, but I fixed a minor typo - sorry...
Attachment #79105 - Attachment is obsolete: true
Don't you also want to reject '?' as well? In fact, wouldn't it be better to test and reject for any non-digit character? In nsFontMetricsXlib.cpp, it might be a good idea to replace the atoi calls with strtol so you can use strtol's extra functionality. On Linux, atoi is just a wrapper for strtol anyway. I wouldn't be surprised if that's also true for other platforms.
This problem could also be solved by checking the whole string for '?' and '*' using strchr/strpbrk.
Attachment #79106 - Attachment is obsolete: true
Requesting r=/sr= ...
The code in the patch looks good but the comment need correction: > + /* Check if we can handle the font name ('*' and '?' are valid in XLFD Both '*' and '?' are valid in the _input_ pattern to XListFonts (XLFD) but are _invalid_ in font names (ie: the results of XListFonts). See the comment #5 http://bugzilla.mozilla.org/show_bug.cgi?id=136743#c5?id=136743
Attachment #80226 - Attachment is obsolete: true
Requesting r=/sr= ...
Attachment #80429 - Flags: review+
Comment on attachment 80429 [details] [diff] [review] New patch for 2002-04-21-08-trunk per bstell's comment sr=attinasi
Attachment #80429 - Flags: superreview+
Status: ASSIGNED → RESOLVED
Closed: 22 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

Creator:
Created:
Updated:
Size: