Bug 97245

Summary: Reduce redundant code in SimpleFontData[platform]
Product: WebKit Reporter: Stephen Chenney <schenney>
Component: TextAssignee: Stephen Chenney <schenney>
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, eric, jamesr, mitz, noam, senorblanco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 95866    
Bug Blocks:    
Attachments:
Description Flags
Patch eric: review+

Stephen Chenney
Reported 2012-09-20 12:02:10 PDT
There is a platform specific file for, e.g. SimpleFontData.h, but almost all of them have identical code. We can simplify this to reduce code duplication and the chance for errors. It will also make it much clearer exactly how platforms differ in font handling.
Attachments
Patch (16.75 KB, patch)
2012-11-02 08:58 PDT, Stephen Chenney
eric: review+
Eric Seidel (no email)
Comment 1 2012-09-20 13:23:25 PDT
Yay!
Stephen Chenney
Comment 2 2012-11-02 07:57:14 PDT
SimpleFontData::smallCapsFontData: All platforms identical code with different ways of defining the constant for "small" and an extra comment for FreeType. All the constahnts are 0.7, but defined in different ways. There is absolutely no need for platform specific code here. SimpleFontData::emphasisMarkFontData: All platforms identical except for the way in which they define 0.5 for the constant. SimpleFontData::boundsForGlyph SimpleFontData::widthForGlyph Already a common core with platform[] code. SimpleFontData::determinePitch Genuinely different methods SimpleFontData::createScaledFontData Genuinely different methods
Stephen Chenney
Comment 3 2012-11-02 08:58:14 PDT
Created attachment 172073 [details] Patch Easier than I thought.
Eric Seidel (no email)
Comment 4 2012-11-02 09:03:35 PDT
Comment on attachment 172073 [details] Patch LGTM.
Stephen Chenney
Comment 5 2012-11-02 15:30:39 PDT
Note You need to log in before you can comment on or make changes to this bug.