Bug 131967 - [OS X] Glyph spacing for system fonts may be incorrect
Summary: [OS X] Glyph spacing for system fonts may be incorrect
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-04-21 19:39 PDT by Myles C. Maxfield
Modified: 2014-04-22 14:07 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.80 KB, patch)
2014-04-21 19:41 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (4.96 KB, patch)
2014-04-22 12:37 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (1.53 KB, patch)
2014-04-22 14:05 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2014-04-21 19:39:09 PDT
[OS X] Glyph spacing for system fonts may be incorrect
Comment 1 Myles C. Maxfield 2014-04-21 19:41:04 PDT
Created attachment 229852 [details]
Patch
Comment 2 WebKit Commit Bot 2014-04-21 19:42:24 PDT
Attachment 229852 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm:376:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Myles C. Maxfield 2014-04-21 19:43:27 PDT
<rdar://problem/16559521>
Comment 4 Myles C. Maxfield 2014-04-21 19:44:08 PDT
Style check is a false negative, though I don't think it's feasible to fix the checker scripts because there are preprocessor macros at play here.
Comment 5 Dean Jackson 2014-04-22 10:31:32 PDT
Comment on attachment 229852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229852&action=review

> Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm:378
> +    if (
> +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
> +            !CTFontDescriptorIsSystemUIFont(descriptor.get()) &&
> +#endif
> +            (horizontal || m_isBrokenIdeographFallback)) {

I don't know the performance implications, but could you switch to have the ALWAYS test first? That will make the style bot happy.
Comment 6 Myles C. Maxfield 2014-04-22 12:37:37 PDT
Created attachment 229907 [details]
Patch
Comment 7 Simon Fraser (smfr) 2014-04-22 12:40:01 PDT
Comment on attachment 229907 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229907&action=review

> Source/WebCore/ChangeLog:11
> +        (WebCore::SimpleFontData::platformWidthForGlyph): Update to use CTFontGetAdvancesForGlyphs() for system fonts

You don't explain the horizontal ? kCTFontHorizontalOrientation : kCTFontVerticalOrientation change.

> Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm:384
> +    if ((horizontal || m_isBrokenIdeographFallback) && !hasCustomTracking(m_platformData.ctFont())) {

So much better!
Comment 8 Myles C. Maxfield 2014-04-22 13:39:30 PDT
http://trac.webkit.org/changeset/167679
Comment 9 Myles C. Maxfield 2014-04-22 14:05:31 PDT
Reopening to attach new patch.
Comment 10 Myles C. Maxfield 2014-04-22 14:05:35 PDT
Created attachment 229912 [details]
Patch