Closed Bug 167759 Opened 22 years ago Closed 19 years ago

Form button text is drawing using a font of default language instead of the language of the page

Categories

(Core :: Internationalization, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 251637
mozilla1.3alpha

People

(Reporter: nhottanscp, Assigned: nhottanscp)

Details

(Keywords: intl)

Attachments

(2 files)

Visit a page with a button, http://www.mozilla.org/search.html
The button text is rendered differently depends on the default language setting.
The following code calls GetMetricsFor() without lang which let the default lang
to be used.

http://lxr.mozilla.org/seamonkey/source/layout/html/forms/src/nsFormControlHelper.cpp#150
150 nsresult nsFormControlHelper::GetFrameFontFM(nsIPresContext* aPresContext,
151                                          nsIFormControlFrame * aFrame,
152                                          nsIFontMetrics** aFontMet)
153 {
154   // Initialize with default font
155   const nsFont * font = nsnull;
156   // Get frame font
157   if (NS_SUCCEEDED(aFrame->GetFont(aPresContext, font))) {
158     nsCOMPtr<nsIDeviceContext> deviceContext;
159     aPresContext->GetDeviceContext(getter_AddRefs(deviceContext));
160     NS_ASSERTION(deviceContext, "Couldn't get the device context");
161     if (font != nsnull) { // Get font metrics
162       return deviceContext->GetMetricsFor(*font, *aFontMet);
163     }
164   }
165   return NS_ERROR_FAILURE;
166 } 

When I modified a code to pass "x-western" to GetMetricsFor() then the button is
drawn using Western font even the system default language is Japanese.
Need to find out how to get lang of the current document.

Keywords: intl
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2beta
QA Contact: ruixu → ylong
Target Milestone: mozilla1.2beta → mozilla1.3alpha
Based on the description and on comment #3, this is the same issue as bug 251637
(which really should have been marked as a duplicate of this).
Marking as duplicate - hoping that someone (perhaps rbs@maths.uq.edu.au) can verify.

*** This bug has been marked as a duplicate of 251637 ***
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: