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)
Core Graveyard
GFX
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.0
People
(Reporter: timeless, Assigned: roland.mainz)
Details
(Keywords: assertion)
Attachments
(2 files, 4 obsolete files)
40.03 KB,
text/plain
|
Details | |
1.63 KB,
patch
|
timeless
:
review+
attinasi
:
superreview+
|
Details | Diff | Splinter Review |
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.
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
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 :)
Assignee | ||
Comment 4•23 years ago
|
||
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 ?
Comment 5•23 years ago
|
||
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.
Comment 6•23 years ago
|
||
Since there is no way for the font code to specify these fonts I suggest
we consider them invalid.
Assignee | ||
Comment 7•23 years ago
|
||
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
Assignee | ||
Updated•23 years ago
|
Attachment #78733 -
Flags: needs-work+
Assignee | ||
Updated•23 years ago
|
Summary: xlib complains a lot → xlib complains a lot about fonts with '*' in the XLFD string
Assignee | ||
Updated•23 years ago
|
Target Milestone: --- → mozilla1.0
Assignee | ||
Comment 8•23 years ago
|
||
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
Assignee | ||
Comment 10•23 years ago
|
||
Same patch as previous one, but I fixed a minor typo - sorry...
Attachment #79105 -
Attachment is obsolete: true
Comment 11•23 years ago
|
||
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.
Comment 12•22 years ago
|
||
This problem could also be solved by checking the whole string for '?' and '*'
using strchr/strpbrk.
Assignee | ||
Comment 13•22 years ago
|
||
Attachment #79106 -
Attachment is obsolete: true
Assignee | ||
Comment 14•22 years ago
|
||
Requesting r=/sr= ...
Comment 15•22 years ago
|
||
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
Assignee | ||
Comment 16•22 years ago
|
||
Attachment #80226 -
Attachment is obsolete: true
Assignee | ||
Comment 17•22 years ago
|
||
Requesting r=/sr= ...
Comment 18•22 years ago
|
||
Attachment #80429 -
Flags: review+
Comment 19•22 years ago
|
||
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+
Assignee | ||
Comment 20•22 years ago
|
||
Patch checked in
(http://bonsai.mozilla.org/cvsquery.cgi?module=MozillaTinderboxAll&branch=HEAD&cvsroot=/cvsroot&date=explicit&mindate=1020129780&maxdate=1020130320&who=bzbarsky%25mit.edu),
marking bug as FIXED.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•