Skip to content

Commit 69346d3

Browse files
committed
Fix smallcaps
The default implementation to get a derived font with a different size just copies the platform data and sets the size. We need a new BFont, though, to avoid the size change in other text that is using the original.
1 parent dc4276d commit 69346d3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Source/WebCore/platform/graphics/FontPlatformData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ FontPlatformData FontPlatformData::cloneWithSyntheticOblique(const FontPlatformD
7676
}
7777
#endif
7878

79-
#if !USE(FREETYPE) && !PLATFORM(COCOA)
79+
#if !USE(FREETYPE) && !PLATFORM(COCOA) && !PLATFORM(HAIKU)
8080
// FIXME: Don't other platforms also need to reinstantiate their copy.m_font for scaled size?
8181
FontPlatformData FontPlatformData::cloneWithSize(const FontPlatformData& source, float size)
8282
{

Source/WebCore/platform/graphics/haiku/FontPlatformDataHaiku.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ FontPlatformData::FontPlatformData(const BFont& font, const FontDescription& fon
132132
}
133133

134134

135+
FontPlatformData FontPlatformData::cloneWithSize(const FontPlatformData& source, float size)
136+
{
137+
FontPlatformData copy(source);
138+
copy.m_font = std::make_shared<BFont>(source.font());
139+
copy.updateSize(size);
140+
return copy;
141+
}
142+
143+
135144
void FontPlatformData::updateSize(float size)
136145
{
137146
m_size = size;

0 commit comments

Comments
 (0)