#41461 Japanese is not wrapped in correct position compared with ascii.

r/sr = attinasi
We should use document langGroup to load font and check width. Locale langGroup will not work well.
This commit is contained in:
shanjian%netscape.com 2001-07-24 21:45:45 +00:00
Родитель 619b7035bf
Коммит 0f3690298d
2 изменённых файлов: 26 добавлений и 2 удалений

Просмотреть файл

@ -2170,7 +2170,19 @@ nsHTMLReflowState::ComputeHorizontalValue(nscoord aContainingBlockWidth,
else {
const nsStyleFont* font;
frame->GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&) font);
rendContext->SetFont(font->mFont);
const nsStyleVisibility* vis;
(const nsStyleVisibility*)frame->GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
nsCOMPtr<nsIDeviceContext> deviceContext;
rendContext->GetDeviceContext(*getter_AddRefs(deviceContext));
nsCOMPtr<nsIAtom> langGroup;
if (vis->mLanguage) {
vis->mLanguage->GetLanguageGroup(getter_AddRefs(langGroup));
}
nsCOMPtr<nsIFontMetrics> fm;
deviceContext->GetMetricsFor(font->mFont, langGroup, *getter_AddRefs(fm));
rendContext->SetFont(fm);
nscoord fontWidth;
rendContext->GetWidth('M', fontWidth);
aResult = aCoord.GetIntValue() * fontWidth;

Просмотреть файл

@ -2170,7 +2170,19 @@ nsHTMLReflowState::ComputeHorizontalValue(nscoord aContainingBlockWidth,
else {
const nsStyleFont* font;
frame->GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&) font);
rendContext->SetFont(font->mFont);
const nsStyleVisibility* vis;
(const nsStyleVisibility*)frame->GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
nsCOMPtr<nsIDeviceContext> deviceContext;
rendContext->GetDeviceContext(*getter_AddRefs(deviceContext));
nsCOMPtr<nsIAtom> langGroup;
if (vis->mLanguage) {
vis->mLanguage->GetLanguageGroup(getter_AddRefs(langGroup));
}
nsCOMPtr<nsIFontMetrics> fm;
deviceContext->GetMetricsFor(font->mFont, langGroup, *getter_AddRefs(fm));
rendContext->SetFont(fm);
nscoord fontWidth;
rendContext->GetWidth('M', fontWidth);
aResult = aCoord.GetIntValue() * fontWidth;