diff --git a/spec/workspace-element-spec.coffee b/spec/workspace-element-spec.coffee index cf773b4ef..efb1d1b26 100644 --- a/spec/workspace-element-spec.coffee +++ b/spec/workspace-element-spec.coffee @@ -47,9 +47,14 @@ describe "WorkspaceElement", -> it "updates the font-family based on the 'editor.fontFamily' config value", -> initialCharWidth = editor.getDefaultCharWidth() - expect(getComputedStyle(editorElement).fontFamily).toBe atom.config.get('editor.fontFamily') + fontFamily = atom.config.get('editor.fontFamily') + fontFamily += ", 'Apple Color Emoji'" if process.platform is 'darwin' + expect(getComputedStyle(editorElement).fontFamily).toBe fontFamily + atom.config.set('editor.fontFamily', 'sans-serif') - expect(getComputedStyle(editorElement).fontFamily).toBe atom.config.get('editor.fontFamily') + fontFamily = atom.config.get('editor.fontFamily') + fontFamily += ", 'Apple Color Emoji'" if process.platform is 'darwin' + expect(getComputedStyle(editorElement).fontFamily).toBe fontFamily expect(editor.getDefaultCharWidth()).not.toBe initialCharWidth it "updates the line-height based on the 'editor.lineHeight' config value", -> diff --git a/src/workspace-element.coffee b/src/workspace-element.coffee index 8f6dca48a..02ff2e5b4 100644 --- a/src/workspace-element.coffee +++ b/src/workspace-element.coffee @@ -44,10 +44,15 @@ class WorkspaceElement extends HTMLElement @subscriptions.add @config.onDidChange 'editor.lineHeight', @updateGlobalTextEditorStyleSheet.bind(this) updateGlobalTextEditorStyleSheet: -> + fontFamily = @config.get('editor.fontFamily') + # TODO: There is a bug in how some emojis (e.g. ❤️) are rendered on OSX. + # This workaround should be removed once we update to Chromium 51, where the + # problem was fixed. + fontFamily += ', "Apple Color Emoji"' if process.platform is 'darwin' styleSheetSource = """ atom-text-editor { font-size: #{@config.get('editor.fontSize')}px; - font-family: #{@config.get('editor.fontFamily')}; + font-family: #{fontFamily}; line-height: #{@config.get('editor.lineHeight')}; } """