Commit 37c59c7c authored by evan@chromium.org's avatar evan@chromium.org
Browse files

2010-04-27 Evan Martin <evan@chromium.org>

        Reviewed by David Levin.

        [chromium] bold bengali text not rendered properly on Linux
        https://bugs.webkit.org/show_bug.cgi?id=37904

        Add a layout test containing some bold Bengali text.

        * fast/text/international/bold-bengali.html: Added.
        * platform/chromium-linux/fast/text/international/bold-bengali-expected.checksum: Added.
        * platform/chromium-linux/fast/text/international/bold-bengali-expected.png: Added.
        * platform/chromium-linux/fast/text/international/bold-bengali-expected.txt: Added.
2010-04-27  Evan Martin  <evan@chromium.org>

        Reviewed by David Levin.

        [chromium] bold bengali text not rendered properly on Linux
        https://bugs.webkit.org/show_bug.cgi?id=37904

        We must let Skia do font fallback, rather than picking a font name
        then handing that to Skia.  For example, if we have Bengali text and
        choose FreeSans + fake bold, and then later reuse the name, Skia will
        helpfully use FreeSansBold (which doesn't cover Bengali).

        Test: fast/text/international/bold-bengali.html

        * platform/graphics/chromium/FontCacheLinux.cpp:
        (WebCore::FontCache::getFontDataForCharacters):
2010-04-27  Evan Martin  <evan@chromium.org>

        Reviewed by David Levin.

        [chromium] bold bengali text not rendered properly on Linux
        Roll forward Chrome DEPS so we get new Skia API.

        * DEPS: update Chrome to r45696.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cac2e10a
2010-04-27 Evan Martin <evan@chromium.org>
Reviewed by David Levin.
[chromium] bold bengali text not rendered properly on Linux
https://bugs.webkit.org/show_bug.cgi?id=37904
Add a layout test containing some bold Bengali text.
* fast/text/international/bold-bengali.html: Added.
* platform/chromium-linux/fast/text/international/bold-bengali-expected.checksum: Added.
* platform/chromium-linux/fast/text/international/bold-bengali-expected.png: Added.
* platform/chromium-linux/fast/text/international/bold-bengali-expected.txt: Added.
2010-04-27 Adam Barth <abarth@webkit.org>
 
Reviewed by Darin Adler.
......
<meta charset=utf-8>
<p>This test verifies we can render bold Bengali properly. (This is complicated on Linux because it's typically covered
by fake-bolded FreeSans even though there's also a FreeSansBold available.)</p>
<p>The test passes if the two words below look similar, but the top one is bold. There should be no missing-glyph
boxes.</p>
<p><b>বাংলা</b><p>
<p>বাংলা</p>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x40
RenderText {#text} at (0,0) size 780x39
text run at (0,0) width 328: "This test verifies we can render bold Bengali properly. "
text run at (328,0) width 452: "(This is complicated on Linux because it's typically covered by fake-bolded"
text run at (0,20) width 370: "FreeSans even though there's also a FreeSansBold available.)"
RenderBlock {P} at (0,56) size 784x20
RenderText {#text} at (0,0) size 704x19
text run at (0,0) width 459: "The test passes if the two words below look similar, but the top one is bold. "
text run at (459,0) width 245: "There should be no missing-glyph boxes."
RenderBlock {P} at (0,92) size 784x20
RenderInline {B} at (0,0) size 35x19
RenderText {#text} at (0,0) size 35x19
text run at (0,0) width 35: "\x{9AC}\x{9BE}\x{982}\x{9B2}\x{9BE}"
RenderBlock {P} at (0,128) size 784x0
RenderBlock {P} at (0,128) size 784x20
RenderText {#text} at (0,0) size 35x19
text run at (0,0) width 35: "\x{9AC}\x{9BE}\x{982}\x{9B2}\x{9BE}"
2010-04-27 Evan Martin <evan@chromium.org>
Reviewed by David Levin.
[chromium] bold bengali text not rendered properly on Linux
https://bugs.webkit.org/show_bug.cgi?id=37904
We must let Skia do font fallback, rather than picking a font name
then handing that to Skia. For example, if we have Bengali text and
choose FreeSans + fake bold, and then later reuse the name, Skia will
helpfully use FreeSansBold (which doesn't cover Bengali).
Test: fast/text/international/bold-bengali.html
* platform/graphics/chromium/FontCacheLinux.cpp:
(WebCore::FontCache::getFontDataForCharacters):
2010-04-27 James Robinson <jamesr@chromium.org>
 
Reviewed by Darin Adler.
......@@ -116,6 +116,8 @@ namespace WebCore {
#endif
#if OS(LINUX)
static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);
// This code is currently in the process of getting rejiggered, and though
// it is not currently used, it will hopefully be used again soon.
static String getFontFamilyForCharacters(const UChar*, size_t numCharacters);
#endif
......
......@@ -58,12 +58,27 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font,
const UChar* characters,
int length)
{
String family = ChromiumBridge::getFontFamilyForCharacters(characters, length);
if (family.isEmpty())
int style = SkTypeface::kNormal;
if (font.fontDescription().weight() >= FontWeightBold)
style |= SkTypeface::kBold;
if (font.fontDescription().italic())
style |= SkTypeface::kItalic;
SkTypeface* tf = SkTypeface::CreateForChars(characters, length * 2,
static_cast<SkTypeface::Style>(style));
if (!tf)
return 0;
AtomicString atomicFamily(family);
return getCachedFontData(getCachedFontPlatformData(font.fontDescription(), atomicFamily, false));
// FIXME: we don't have a family name for this font.
// However, the family name within FontPlatformData is only used when picking
// a render style for the font, so it's not too great of a loss.
FontPlatformData result(tf,
"",
font.fontDescription().computedSize(),
(style & SkTypeface::kBold) && !tf->isBold(),
(style & SkTypeface::kItalic) && !tf->isItalic());
tf->unref();
return getCachedFontData(&result);
}
SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
......
2010-04-27 Evan Martin <evan@chromium.org>
Reviewed by David Levin.
[chromium] bold bengali text not rendered properly on Linux
Roll forward Chrome DEPS so we get new Skia API.
* DEPS: update Chrome to r45696.
2010-04-27 Andrey Kosyakov <caseq@chromium.org>
Reviewed by Pavel Feldman.
......
......@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
'chromium_rev': '45294',
'chromium_rev': '45696',
'pthreads-win32_rev': '26716',
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment