Closed
Bug 238501
Opened 20 years ago
Closed 10 years ago
GetTextCharset is unreliable for bitmap fonts on NT3.51
Categories
(Core Graveyard :: GFX: Win32, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: neil, Assigned: neil)
Details
Attachments
(3 files, 1 obsolete file)
1.43 KB,
patch
|
emaijala+moz
:
review+
|
Details | Diff | Splinter Review |
63.14 KB,
application/x-fon
|
Details | |
8.40 KB,
patch
|
Details | Diff | Splinter Review |
I've found an ANSI font for which GetTextCharset returns OEM_CHARSET. Since GetTextMetrics returns a .tmCharSet of ANSI_CHARSET for the same font, I suggest that we switch to using GetTextMetrics instead.
Assignee | ||
Comment 1•20 years ago
|
||
Assignee: win32 → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
Assignee | ||
Updated•20 years ago
|
Attachment #144656 -
Flags: superreview?(rbs)
Attachment #144656 -
Flags: review?(ere)
Comment on attachment 144656 [details] [diff] [review] Proposed patch >+ GetTextMetrics(aDC, &tm); http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_6r lf.asp Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. Please check the return value (i know lots of our code doesn't, that's not a good excuse)
Assignee | ||
Comment 3•20 years ago
|
||
Actually, that's somewhat unlikely... the function called another function that passed a GetTextMetrics call shortly before arriving here. I can investigate folding the two GetTextMetrics calls together if you like.
Comment 4•20 years ago
|
||
Comment on attachment 144656 [details] [diff] [review] Proposed patch You don't need the & (~0xFF)) check anymore? thanks for making this patch.
Assignee | ||
Comment 5•20 years ago
|
||
(In reply to comment #4) >(From update of attachment 144656 [details] [diff] [review]) >You don't need the & (~0xFF)) check anymore? No, metrics.tmCharSet is a BYTE.
Assignee | ||
Comment 6•20 years ago
|
||
This takes the call to GetTextMetrics out of GetNAME and into the caller...
I cannot vouch for this patch based on a single example, and no other history on the matter. Why, then, should GetTextMetrics() be more trustworthy than GetTextCharset() in general? Because of that single font? What if there is another font which causes GetTextMetrics() to be wrong and GetTextCharset() to be correct. There are cases of badly designed fonts, and your font could be one. Since there are tons of legacy code out there that depend on GetTextCharset(), solid evidence/history (e.g., a KB article) is needed to consider it unreliable. BTW, your alternative is not equivalent. Suppose that the new GetNAME() fails _latter_, for example on the line with buffer.EnsureElemCapacity(), the caller will not have the information that it is "other error" anymore.
Assignee | ||
Comment 8•20 years ago
|
||
(In reply to comment #7) >There are cases of badly designed fonts, and your font could be one. I'd better complain to Microsoft for badly designing their font then? (From update of attachment 144744 [details] [diff] [review]) The new GetNAME is only called for truetype fonts so it does not have to distinguish the non-truetype "error" from the other error cases.
Comment 9•20 years ago
|
||
Comment on attachment 144656 [details] [diff] [review] Proposed patch I see no problem in using GetTextMetrics. The font is apparently ok as it works fine in WinXP, but NT 3.51 has a problem with GetTextCharSet. r=ere
Attachment #144656 -
Flags: review?(ere) → review+
Assignee | ||
Comment 10•20 years ago
|
||
I was confused, because my WordPad does not list the font as a bitmap font. Trust Microsoft to make my life difficult ;-)
Assignee | ||
Updated•20 years ago
|
Summary: GetTextCharset is unreliable → GetTextCharset is unreliable for bitmap fonts on NT3.51
Comment 11•20 years ago
|
||
Comment on attachment 144656 [details] [diff] [review] Proposed patch Needs more info.
Attachment #144656 -
Flags: superreview?(rbs)
Assignee | ||
Comment 12•19 years ago
|
||
Attachment #144744 -
Attachment is obsolete: true
Updated•16 years ago
|
Product: Core → Core Graveyard
Comment 13•10 years ago
|
||
This bug has been buried in the graveyard and has not been updated in over 5 years. It is probably safe to assume that it will never be fixed, so resolving as WONTFIX. [Mass-change filter: graveyard-wontfix-2014-09-24]
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•